https://github.com/shiftcode/github-action-skip
skips a github action based on some input parameter
https://github.com/shiftcode/github-action-skip
Last synced: 11 months ago
JSON representation
skips a github action based on some input parameter
- Host: GitHub
- URL: https://github.com/shiftcode/github-action-skip
- Owner: shiftcode
- License: mit
- Created: 2019-11-08T14:47:24.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-06-16T10:10:09.000Z (over 1 year ago)
- Last Synced: 2025-03-20T10:20:03.746Z (11 months ago)
- Language: TypeScript
- Size: 2.62 MB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# shiftcode/github-action-skip


Github Actions have [native support](https://github.blog/changelog/2021-02-08-github-actions-skip-pull-request-and-push-workflows-with-skip-ci/) to skip an entire workflow depending on commit message. But since we rely on status checks
for our Pull Requests to be green, we need another option.
This action accepts an input string `skipOnCommitMsg` which will be used to check if the commit message contains the given string.
If yes the output `shouldExecute` will be set to `false`. `true` otherwise. For full input / output list and other configurations check [`action.yml`](./action.yml).
## Example GitHub Workflow definition
This example shows how to setup two dependant jobs, the second will only be executed if the output from `checkExecution` job is `false`.
```yaml
# jobs
checkExecution:
runs-on: ubuntu-latest
outputs:
shouldExecute: ${{ steps.stepCheckExecution.outputs.shouldExecute }}
steps:
- id: stepCheckExecution
name: Check for execution
uses: shiftcode/github-action-skip@releases/v2-alpha.0
with:
skipOnCommitMsg: "[skip_build]"
githubToken: ${{secrets.GH_TOKEN_3}}
build:
runs-on: ubuntu-latest
needs: checkExecution
# only execute if not skipped by commit message
if: needs.checkExecution.outputs.shouldExecute == 'true'
steps: ...
```
## Development
### new version
1) implement your changes
2) commit changes (pre-commit hook will do some code checks / changes and build the artifacts using ncc)
3) set tag `git tag -a -m "my fancy release" v0.0.X`
4) push with tags `git push --follow-tags`