| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Push an empty commit to a pull request branch to re-trigger CI. Intended for label-driven workflows: when a maintainer adds a label (default trigger-ci), the action removes the label and pushes an empty commit to the PR head branch.
If the PR comes from a fork and Allow edits from maintainers is disabled, the action posts a comment explaining how to trigger CI manually.
Create a repository secret named GHACTION_PAT before using this action.
The PAT must be able to:
In GitHub: Settings → Secrets and variables → Actions → New repository secret → name GHACTION_PAT, value your PAT.
- uses: Shamrock-code/action-trigger-ci-empty-commit@v1
with:
github_token: ${{ secrets.GHACTION_PAT }}This action must run in a workflow triggered by a pull request event so github.event.pull_request is available. The Shamrock setup uses pull_request_target with a label filter:
name: trigger-ci-empty-commit
on:
pull_request_target:
types: [labeled]
concurrency:
group: trigger-ci-${{ github.event.pull_request.number }}
cancel-in-progress: false
jobs:
trigger_ci:
name: Trigger CI with empty commit
if: ${{ github.event.label.name == 'trigger-ci' }}
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
steps:
- uses: Shamrock-code/action-trigger-ci-empty-commit@v1
with:
github_token: ${{ secrets.GHACTION_PAT }}To use a different label, pass the label input and match it in the job if condition.
| Input | Required | Default | Description |
|---|---|---|---|
| github_token | yes | — | Pass ${{ secrets.GHACTION_PAT }}. Used to remove the label, check out the PR branch, push the empty commit, and post comments when push is not possible. |
| label | no | trigger-ci | Label removed after the workflow runs; also referenced in the fork PR comment. |
For PRs from forks, the contributor must enable Allow edits from maintainers. Without that, the action cannot push to the fork branch and will only leave an explanatory comment.
MIT — see LICENSE.
| Back | FazBrowse Home | New Git URL |