This repository publishes GitHub Actions that make it easier to use Auto Merge when using multiple CIs.
If you have multiple CIs in a pull request, each working only under certain conditions, you cannot use GitHub Auto-Merge to force a specific CI to succeed.
For example, in the following figure, the Bazel and Spanner jobs are running and the Kubernetes Manifest job is not.
In this case, no matter which job is required to complete, Auto-Merge cannot be used depending on the content of the update.
Check All CI Completion checks if all launched CIs are successful or not. This makes it easier to use GitHub Auto-merge by forcing the Check All CI Completion job to succeed.
- uses: lirlia/check-all-ci-completion-action@latest
with:
# Default: env.GITHUB_SHA
# commit hash to get check suites
commit-hash: 'put any git commit hash'
# Default: false
# if true, use exit 0 whether CI results are not completed or not success
disable-errexit: 'true' or 'false'
# Default: 000000000000000 (dummy value)
# ignoring check suite ids
ignore-check-suite-ids: '11111111,22222222'
# Default: -1 (loop until timeout)
# How many loop in this CI
loop-count: '10'
# Default: 300 seconds
# Sleep seconds between check another jobs status
sleep-seconds: '300'
# Default: 1800 seconds
# How long maintains this CI (This job waits for another jobs completion)
timeout-seconds: '1800'
name | value | description |
---|---|---|
result | null / success / failure | another CI job result(if all jobs are success or neutral, result is success) |
status | null / completed / in-progress | another CI job status |
name: check-all-ci-result
on:
push:
branches:
- '**' # matches every branch
- '!main' # excludes main
jobs:
check-another-ci:
name: check
runs-on: ubuntu-20.04
steps:
- uses: lirlia/[email protected]
- [Setting] → [Branches] → [Branch protection rule] → [Edit]
- enable "Require status checks to pass before merging"
- enable "Require branches to be up to date before merging"
- set "check" in "Status checks that are required."
This job will be charged for GitHub Actions because it will continue to wait while waiting for other jobs to complete. Therefore, depending on your use case, you may be charged an unexpected amount.