Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use check-spelling/check-spelling@v0.0.20 #97

Merged
merged 1 commit into from
Aug 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/actions/spelling/allow.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
abspath
abstractmethod
agg
api
appendable
argparse
args
argv
ASer
atexit
autoapi
autocoded
autocode
Autocoders
autocoders
autocoding
autodoc
autoescape
autosectionlabel
backport
baremetal
buf
bytearray
calcsize
changelog
chdir
classmethod
lestarch
LGTM
lgtm
Linux
Prm
prm
Serializables
serializables
timezone
Tlm
tlm
37 changes: 1 addition & 36 deletions .github/actions/spelling/expect.txt
Original file line number Diff line number Diff line change
@@ -1,34 +1,7 @@
abspath
abstractmethod
agg
api
appendable
argparse
args
argv
ASer
atexit
autoapi
autocoded
autocode
Autocoders
autocoders
autocoding
autodoc
autoescape
autosectionlabel
backport
baremetal
buf
bytearray
calcsize
cargs
cexc
cfg
changelog
chdir
ci
classmethod
cls
cmake
cmakelists
Expand Down Expand Up @@ -134,10 +107,6 @@ jsonable
kevin
kwargs
len
lestarch
LGTM
lgtm
Linux
lld
locs
lstrip
Expand All @@ -164,7 +133,7 @@ pathlib
Peet
pexpect
Popen
Prm

proj
ptf
py
Expand Down Expand Up @@ -202,8 +171,6 @@ Sched
SCLK
scm
sdd
Serializables
serializables
setuptools
shutil
someotherpath
Expand Down Expand Up @@ -231,8 +198,6 @@ testbuild
testimpl
textwrap
timebase
timezone
Tlm
toctree
todo
toolchain
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/spelling/patterns.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ value="(?:[0-9a-f]{1,2} )*"
\b([A-Za-z])\g{-1}{3,}\b

#Ignore -Dflags
-D[A_Z_]*
-D[A-Za-z_]*

# Ignore string sequence if it is assigned to a variable and has special symbols | \ / % * & %
=\s*["'].*[\|\\\/\#\*\&\%].*["']
Expand Down
45 changes: 32 additions & 13 deletions .github/workflows/spelling.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,40 @@ on:
types: ['opened', 'reopened', 'synchronize']

jobs:
build:
spelling:
name: Spell checking
permissions:
contents: read
pull-requests: read
actions: read
outputs:
followup: ${{ steps.spelling.outputs.followup }}
runs-on: ubuntu-20.04
if: "contains(github.event_name, 'pull_request') || github.event_name == 'push'"
concurrency:
group: spelling-${{ github.event.pull_request.number || github.ref }}
# note: If you use only_check_changed_files, you do not want cancel-in-progress
cancel-in-progress: true
steps:
- name: checkout-merge
if: "contains(github.event_name, 'pull_request')"
uses: actions/checkout@v2.0.0
- name: check-spelling
id: spelling
uses: check-spelling/check-spelling@v0.0.20
with:
ref: refs/pull/${{github.event.pull_request.number}}/merge
fetch-depth: 5
- name: checkout
if: "!contains(github.event_name, 'pull_request')"
uses: actions/checkout@v2.0.0
with:
fetch-depth: 5
- uses: check-spelling/check-spelling@v0.0.19
suppress_push_for_open_pull_request: 1
checkout: true
post_comment: 0

comment:
name: Report
runs-on: ubuntu-latest
needs: spelling
permissions:
contents: write
Copy link
Contributor

@Joshua-Anderson Joshua-Anderson Aug 22, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does the spelling action need contents write permissions?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GitHub treats commenting on a commit as a write operation (on the repository contents). And commenting on a pul request as a write operation (on pull requests).

It's an unfortunate detail.

But note that the default permissions on most organizations is roughly *: write, so this is actually a reduction in the scope permissions of the workflow.

pull-requests: write
if: (success() || failure()) && needs.spelling.outputs.followup
steps:
- name: comment
uses: check-spelling/check-spelling@v0.0.20
with:
shortest_word: 2
checkout: true
task: ${{ needs.spelling.outputs.followup }}