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

Make terms configurable #3

Merged
merged 5 commits into from
Jun 21, 2022
Merged
Show file tree
Hide file tree
Changes from 3 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
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"
bbugh marked this conversation as resolved.
Show resolved Hide resolved
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
21 changes: 18 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,25 @@ 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
zaherg marked this conversation as resolved.
Show resolved Hide resolved

(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.
- I am using `wip:` here.
- I am using `fixme:` here.
zaherg marked this conversation as resolved.
Show resolved Hide resolved

## 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 --ignore-case --line-number --extended-regexp -e "(${tag})+(:)" :^.github)
zaherg marked this conversation as resolved.
Show resolved Hide resolved

echo "${result}"

Expand Down