Skip to content

This repository exposes GitHub Actions that check the completion of all CIs, as indicated by the GitHub check.

License

Notifications You must be signed in to change notification settings

lirlia/check-all-ci-completion-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Check All CI Completion (GitHub Actions)

英語(Eng) | 日本語(JP)

This repository publishes GitHub Actions that make it easier to use Auto Merge when using multiple CIs.

Concept

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.

multi-job

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.

check-job

Usage

- 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'

Outputs

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

Full yaml (for main branch)

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]

GitHub Setting

  • [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."

⚠️Caution⚠️

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.

License

License

About

This repository exposes GitHub Actions that check the completion of all CIs, as indicated by the GitHub check.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •