Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jsok/serialize-workflow-action
A GitHub Action to serialize workflow runs
https://github.com/jsok/serialize-workflow-action
Last synced: about 2 months ago
JSON representation
A GitHub Action to serialize workflow runs
- Host: GitHub
- URL: https://github.com/jsok/serialize-workflow-action
- Owner: jsok
- License: apache-2.0
- Created: 2022-01-04T02:37:12.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-01-04T03:06:10.000Z (about 3 years ago)
- Last Synced: 2024-11-19T20:07:08.399Z (2 months ago)
- Size: 7.81 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Serialize Workflow action
A GitHub Action to serialize workflow runs.
This action will poll the currently `queued` and `in_progress` workflow
runs. If there are one or more workflow runs whose *run number* is less than the
current run number, the actions will wait.Requires `bash`, `gh` and `jq`, which should be all present on a GitHub hosted runner.
## Motivation
Implementing serialized workflow runs is not possible using
[`concurrency`][concurrency] since it will cancel any previously pending run as
new runs are queued. Sometimes you wish to run every queued workflow run,
rather than just the most recently queued one.## Billing
Since this action is polling, a workflow run will be billed even if it is
waiting for its turn to run. This may be expensive if you have many or long
running jobs.## Inputs
### `github-token`
A GitHub access token to perform API calls.
It must have the following permissions:* `actions`: `read`
### `workflow`
**Optional**: The workflow ID or filename, if omitted will use the currently running workflow.
### `run`
**Optional**: The workflow run number, defaults to the current run number.
## Outputs
Presently, none.
## Example usage
```yaml
jobs:
main:
runs-on: ubuntu-latest
permissions:
actions: read
timeout-minutes: 10 # recommended that you set an overall job timeout
steps:
- uses: jsok/serialize-workflow-action@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
```[concurrency]: https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#concurrency