Skip to content

Commit

Permalink
Make terms configurable (#3)
Browse files Browse the repository at this point in the history
Co-authored-by: Brian Bugh <438465+bbugh@users.noreply.github.com>
  • Loading branch information
zaherg and bbugh committed Jun 21, 2022
1 parent 9f9584a commit 301f4db
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,7 @@ jobs:
steps:
- uses: actions/checkout@v1
- uses: ./
with:
terms: "wip|fix|fixme"
env:
ENVIRONMENT: test
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM alpine/git:1.0.7

LABEL com.github.actions.name="FIXME check"
LABEL com.github.actions.description="Check your code for `FIXME` labels"
LABEL com.github.actions.description="Check code for specific terms (FIXME, WIP, etc.) and fail (with code annotations) if any are found."
LABEL com.github.actions.icon="code"
LABEL com.github.actions.color="yellow"

Expand Down
19 changes: 16 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# action-fixme-check

Checks the code base for any `FIXME:` (with the colon) and fails the check if
any are found. Useful if you want to make sure that you don't miss any required
changes in the code base before merging a PR.
Checks the code base for any terms ending with a colon, and fail the check if
any are found. The default term is `FIXME:`. You can add or change the terms
using the `term` parameter, see [Installation](#Installation) below.
Useful if you want to make sure that you don't miss any required changes in the
code base before merging a PR.

It runs very fast, taking only a few seconds to finish even on a very large
codebase. All files in the repository will be read, including binary files (it
Expand Down Expand Up @@ -30,12 +32,23 @@ jobs:
steps:
- uses: actions/checkout@v1
- uses: bbugh/action-fixme-check@master # or @ the latest release
with:
terms: 'WIP|FIXME' # optional, defaults to `FIXME`
```
## Support
- [Official workflow configuration docs](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions)
## Testing words
(Used for testing this action on itself.)
- I am using `WIP:` here.
- I am using `FIXME:` here.
- Nothing to see here.
- I am using `FIX:` here.

## License

The `action-fixme-check` library is available as open source under the terms of
Expand Down
8 changes: 7 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
name: 'FIXME alert'
description: 'Check code for `FIXME:` and fail (with annotations) if any are found.'
description: 'Check code for specific terms (FIXME, WIP, etc.) and fail (with code annotations) if any are found.'
author: '@bbugh'
branding:
icon: 'list'
color: 'orange'
runs:
using: 'docker'
image: 'Dockerfile'
inputs:
terms:
description: 'The pipe-delimited searchable terms to pass as a regex group to `git grep`.'
required: false
default: "FIXME"

4 changes: 2 additions & 2 deletions lib/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ cp /git-grep-problem-matcher.json "$matcher_path"

echo "::add-matcher::git-grep-problem-matcher.json"

tag="FIXME"
result=$(git grep --no-color -n -e "${tag}:")
tag=${INPUT_TERMS:=FIXME}
result=$(git grep --no-color --line-number --extended-regexp -e "(${tag})+(:)" :^.github)

echo "${result}"

Expand Down

0 comments on commit 301f4db

Please sign in to comment.