https://github.com/domjtalbot/skip-commit
:question: A GitHub Action to check if the last commit message contains a skip request.
https://github.com/domjtalbot/skip-commit
commit-message github-action github-actions skip
Last synced: about 1 year ago
JSON representation
:question: A GitHub Action to check if the last commit message contains a skip request.
- Host: GitHub
- URL: https://github.com/domjtalbot/skip-commit
- Owner: domjtalbot
- License: mit
- Created: 2021-05-30T11:41:56.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2023-12-15T02:42:52.000Z (over 2 years ago)
- Last Synced: 2025-06-08T23:35:56.443Z (about 1 year ago)
- Topics: commit-message, github-action, github-actions, skip
- Homepage:
- Size: 19.5 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Skip Commit
Does the last commit message contain a skip request?
## Usage
An example workflow showing how the following commit can be used to skip the `test` job.
```bash
chore: update documentation [skip test-job]
```
```yaml
name: Example workflow
on: pull_request
jobs:
skip-commit:
runs-on: ubuntu-20.04
outputs:
should-skip: ${{ steps.skip-commit.outputs.should-skip == 'true' }}
steps:
# Checkout codebase triggered by commit
- name: Checkout Codebase
uses: actions/checkout@v2.3.4
with:
# Fetch depth is 2 so that the last pull
# request commit can be read.
fetch-depth: 2
# Does the last commit message contain a skip request?
- id: skip-commit
name: Skip Commit
uses: domjtalbot/skip-commit@v1.0.0
with:
# The string filter to find in the
# last commit.
filter: '"\[skip test-job\]"'
# A test job that only runs when the last commit
# message doesn't contain '[skip example-job]'.
test:
if: ${{ needs.skip-commit.outputs.should-skip != 'true' }}
needs: [skip-commit]
runs-on: ubuntu-20.04
steps:
- name: Tests
runs: echo Running tests...
```