mirror of
https://github.com/pezkuwichain/workflow-stopper.git
synced 2026-04-22 05:37:59 +00:00
36 lines
1.2 KiB
Markdown
36 lines
1.2 KiB
Markdown
# Pezkuwi Workflow Stopper
|
|
|
|
Stops all running and queued workflows in a repository when a CI job fails. This saves compute resources by preventing unnecessary workflow runs from continuing after a failure is detected.
|
|
|
|
## How It Works
|
|
|
|
1. When a CI job fails in `pezkuwi-sdk`, the `workflow-stopper` action is triggered
|
|
2. This action dispatches a workflow in this repository
|
|
3. The workflow uses GitHub API to cancel all running/queued workflows for the same commit SHA
|
|
|
|
## Setup
|
|
|
|
### Required Secrets
|
|
|
|
In this repository (`pezkuwichain/workflow-stopper`):
|
|
- `WORKFLOW_STOPPER_TOKEN` - A GitHub PAT or App token with `actions:write` permission on `pezkuwichain/pezkuwi-sdk`
|
|
|
|
In the target repository (`pezkuwichain/pezkuwi-sdk`):
|
|
- `WORKFLOW_STOPPER_RUNNER_APP_ID` - GitHub App ID
|
|
- `WORKFLOW_STOPPER_RUNNER_APP_KEY` - GitHub App private key
|
|
|
|
### GitHub App Setup
|
|
|
|
1. Create a GitHub App in your organization settings
|
|
2. Grant it `actions:write` permission
|
|
3. Install it on both `workflow-stopper` and `pezkuwi-sdk` repositories
|
|
4. Add the App ID and private key as secrets
|
|
|
|
## Usage
|
|
|
|
This workflow is triggered via `workflow_dispatch` from the `pezkuwi-sdk` repository's CI pipelines.
|
|
|
|
## License
|
|
|
|
Apache-2.0 (same as Pezkuwi SDK)
|