{"id":14069210,"url":"https://github.com/lewagon/wait-on-check-action","last_synced_at":"2025-05-15T04:06:38.563Z","repository":{"id":37005774,"uuid":"263061178","full_name":"lewagon/wait-on-check-action","owner":"lewagon","description":"This action can be used to halt any workflow until required checks for a given ref (e.g., in a sibling workflow) pass successfully. ","archived":false,"fork":false,"pushed_at":"2025-03-24T13:35:09.000Z","size":186,"stargazers_count":359,"open_issues_count":19,"forks_count":62,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-05-08T19:43:36.993Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lewagon.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-05-11T14:09:36.000Z","updated_at":"2025-05-02T21:26:26.000Z","dependencies_parsed_at":"2023-01-04T12:14:58.094Z","dependency_job_id":"f24256d7-654e-499d-b8ae-fb53203aa106","html_url":"https://github.com/lewagon/wait-on-check-action","commit_stats":{"total_commits":229,"total_committers":21,"mean_commits":"10.904761904761905","dds":"0.42358078602620086","last_synced_commit":"37879227790c42deedb424ac8746c2fec5a885e7"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lewagon%2Fwait-on-check-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lewagon%2Fwait-on-check-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lewagon%2Fwait-on-check-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lewagon%2Fwait-on-check-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lewagon","download_url":"https://codeload.github.com/lewagon/wait-on-check-action/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254270646,"owners_count":22042859,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-13T07:06:43.154Z","updated_at":"2025-05-15T04:06:33.549Z","avatar_url":"https://github.com/lewagon.png","language":"Ruby","funding_links":[],"categories":["Ruby"],"sub_categories":[],"readme":"# Wait On Check Action\n\nPause a workflow until a job in another workflow completes successfully.\n\n![Review](https://img.shields.io/github/actions/workflow/status/lewagon/wait-on-check-action/review.yml)\n![Version](https://img.shields.io/github/v/tag/lewagon/wait-on-check-action)\n\nThis action uses the [Checks API](https://docs.github.com/en/rest/checks) to poll for check results. On success, the action exit allowing the workflow resume. Otherwise, the action will exit with status code 1 and fail the whole workflow.\n\nThis is a workaround to GitHub's limitation of non-interdependent workflows :tada:\n\nYou can **run your workflows in parallel** and pause a job until a job in another workflow completes successfully.\n\n## Minimal example\n\n```yml\nname: Test\n\non: [push]\n\njobs:\n  test:\n    name: Run tests\n    runs-on: ubuntu-latest\n      steps:\n        ...\n```\n\n```yml\nname: Publish\n\non: [push]\n\njobs:\n  publish:\n    name: Publish the package\n    runs-on: ubuntu-latest\n    steps:\n      - name: Wait for tests to succeed\n        uses: lewagon/wait-on-check-action@v1.3.4\n        with:\n          ref: ${{ github.ref }}\n          check-name: 'Run tests'\n          repo-token: ${{ secrets.GITHUB_TOKEN }}\n          wait-interval: 10\n      ...\n```\n\n## GHE Support\n\nFor GHE support you just need to pass in `api-endpoint` as an input.\n\n```yml\nname: Publish\n\non: [push]\n\njobs:\n  publish:\n    name: Publish the package\n    runs-on: ubuntu-latest\n    steps:\n      - name: Wait for tests to succeed\n        uses: lewagon/wait-on-check-action@v1.3.4\n        with:\n          ref: ${{ github.ref }}\n          check-name: 'Run tests'\n          repo-token: ${{ secrets.GITHUB_TOKEN }}\n          api-endpoint: YOUR_GHE_API_BASE_URL # Fed to https://octokit.github.io/octokit.rb/Octokit/Configurable.html#api_endpoint-instance_method\n      ...\n```\n\n## Alternatives\n\nIf you can keep the dependent jobs in a single workflow:\n\n```yml\nname: Test and publish\n\non: [push]\n\njobs:\n  test:\n    runs-on: ubuntu-latest\n    steps: ...\n\n  publish:\n    runs-on: ubuntu-latest\n    needs: test\n    steps: ...\n```\n\nIf you can run dependent jobs in a separate workflows in series:\n\n```yml\nname: Publish\n\non:\n  workflow_run:\n    workflows: [\"Test\"]\n    types:\n      - completed\n```\n\n## A real-world scenario\n\n- Pushes to master trigger a `test` job to be run against the application code.\n\n- Pushes to master also trigger a webhook that builds an image on external service such as Quay.\n\n- Once an image is built, a `repository_dispatch` hook is triggered from a third-party service. This triggers a `deploy` job.\n\n- We don't want the `deploy` job to start until the master branch passes its `test` job.\n\n```yml\nname: Trigger deployment on external event\n\non:\n  # https://github.com/lewagon/quay-github-actions-dispatch\n  repository_dispatch:\n    types: [build_success]\n\njobs:\n  deploy:\n    if: startsWith(github.sha, github.event.client_payload.text)\n    name: Deploy a new image\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n\n      - name: Wait for tests to succeed\n        uses: lewagon/wait-on-check-action@v1.3.4\n        with:\n          ref: master\n          check-name: test\n          repo-token: ${{ secrets.GITHUB_TOKEN }}\n          wait-interval: 20\n\n      - name: Save the DigitalOcean kubeconfig\n        uses: digitalocean/action-doctl@master\n        env:\n          DIGITALOCEAN_ACCESS_TOKEN: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}\n        with:\n          args: kubernetes cluster kubeconfig show my-cluster \u003e $GITHUB_WORKSPACE/.kubeconfig\n\n      - name: Upgrade/install chart\n        run: export KUBECONFIG=$GITHUB_WORKSPACE/.kubeconfig \u0026\u0026 make deploy latest_sha=$(echo $GITHUB_SHA | head -c7)}}\n```\n\n## Parameters\n\n### Check name\n\nCheck name goes according to the jobs.\u003cjob_id\u003e.name parameter.\n\nIn this case the job's name is 'test':\n\n```yml\njobs:\n  test:\n    runs-on: ubuntu-latest\n      steps:\n      ...\n```\n\nIn this case the name is 'Run tests':\n\n```yml\njobs:\n  test:\n    name: Run tests\n    runs-on: ubuntu-latest\n      steps:\n      ...\n```\n\nIn this case the names will be:\n\n- Run tests (3.6)\n\n- Run tests (3.7)\n\n```yml\njobs:\n  test:\n    name: Run tests\n    runs-on: ubuntu-latest\n    strategy:\n      matrix:\n        python: [3.6, 3.7]\n```\n\nTo inspect the names as they appear to the API:\n\n```bash\ncurl -u username:$token \\\nhttps://api.github.com/repos/OWNER/REPO/commits/REF/check-runs \\\n-H 'Accept: application/vnd.github.antiope-preview+json' | jq '[.check_runs[].name]'\n```\n\n### Running workflow name\n\nIf you would like to wait for all other checks to complete you may set `running-workflow-name` to the name of the current job and not set a `check-name` parameter.\n\n```yml\nname: Publish\n\non: [push]\n\njobs:\n  publish:\n    name: Publish the package\n    runs-on: ubuntu-latest\n    steps:\n      - name: Wait for other checks to succeed\n        uses: lewagon/wait-on-check-action@v1.3.4\n        with:\n          ref: ${{ github.ref }}\n          running-workflow-name: 'Publish the package'\n          repo-token: ${{ secrets.GITHUB_TOKEN }}\n          wait-interval: 10\n      ...\n```\n\n#### Using running workflow name in reusable workflows\n\nUsing this action in a reusable workflow means accepting a constraint that all calling jobs will have the same name. For example, all calling workflows must call their jobs `caller` (or some more relevant constant) so that if the reused workflow containing the job that uses this action to wait is called `callee` then the task can successfully wait on `caller / callee`. Working example follows.\n\n.github/workflows/caller.yml\n\n```yml\non:\n  push:\njobs:\n  caller:\n    uses: ./.github/workflows/callee.yml\n```\n\n.github/workflows/callee.yml\n\n```yml\non:\n  workflow_call:\njobs:\n  callee:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Wait for Other Workflows\n        uses: lewagon/wait-on-check-action@v1.3.4\n        with:\n          ref: ${{ github.ref }}\n          running-workflow-name: \"caller / callee\"\n          repo-token: ${{ secrets.GITHUB_TOKEN }}\n          wait-interval: 10\n```\n\n### Allowed conclusions\n\nBy default, checks that conclude with either `success` or `skipped` are allowed, and anything else is not. You may configure this with the `allowed-conclusions` option, which is a comma-separated list of conclusions.\n\n```yml\nname: Publish\n\non: [push]\n\njobs:\n  publish:\n    name: Publish the package\n    runs-on: ubuntu-latest\n    steps:\n      - name: Wait for tests to succeed\n        uses: lewagon/wait-on-check-action@v1.3.4\n        with:\n          ref: ${{ github.ref }}\n          check-name: 'Run tests'\n          repo-token: ${{ secrets.GITHUB_TOKEN }}\n          wait-interval: 10\n          allowed-conclusions: success,skipped,cancelled\n      ...\n```\n\n### Using check-regexp\n\nSimilar to the `check-name` parameter, this filters the checks to be waited but using a Regular Expression (aka regexp) to match the check name (jobs.\u003cjob_id\u003e.name)\n\nExample of use:\n\n```yaml\nname: Wait using check-regexp\non:\n  push:\n\njobs:\n  wait-for-check-regexp:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v2\n\n      - name: Wait on tests\n        uses: lewagon/wait-on-check-action@v1.3.3\n        with:\n          ref: ${{ github.sha }}\n          repo-token: ${{ secrets.GITHUB_TOKEN }}\n          running-workflow-name: wait-for-check-regexp\n          check-regexp: .?-task\n```\n\n### Ignore-checks\n\nTo selectively filter checks and ignore specific ones, you can specify the ignore-checks option with a list of comma-separated check names to be ignored.\nExample of use:\n\n```yaml\nname: Wait using check-regexp\non:\n  push:\n\njobs:\n  wait-for-check-regexp:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v2\n\n      - name: Wait on tests\n        uses: lewagon/wait-on-check-action@v1.3.3\n        with:\n          ref: ${{ github.sha }}\n          repo-token: ${{ secrets.GITHUB_TOKEN }}\n          running-workflow-name: wait-for-check-regexp\n          ignore-checks: label1,label2\n```\n\n### Wait interval (optional, default: 10)\n\nAs it could be seen in many examples, there's a parameter `wait-interval`, and sets a time in seconds to be waited between requests to the GitHub API. The default time is 10 seconds.\n\n### Verbose (optional, default: true)\n\nIf true, it prints some logs to help understanding the process (checks found, filtered, conclusions, etc.)\n\n## Auto-pagination\n\nSince we are using Octokit for using GitHub API, we are subject to their limitations. One of them is the pagination max size: if we have more than 100 workflows running, the auto-pagination won't help.\nMore about Octokit auto-pagination can be found [here](https://octokit.github.io/octokit.rb/file.README.html#Pagination:~:text=get.data-,Auto%20Pagination,-For%20smallish%20resource)\nThe solution would be to fetch all pages to gather all running workflows if they're more than 100, but it's still no implemented.\n\n## Tests\n\nThere are sample workflows in the `.github/workflows` directory. Two of them are logging tasks to emulate real-world actions being executed that have to be waited. The important workflows are the ones that use the wait-on-check-action.\n\nA workflow named \"wait_omitting-check-name\" waits for the two simple-tasks, while the one named \"wait_using_check-name\" only waits for \"simple-task\".\n\n## Tooling\n\n### Dependencies\n\nTo install dependencies:\n\n```bash\nbundle install\n```\n\nSome packages must be installed from npm and PyPI:\n\n```bash\nnpm install cspell husky prettier\npip install bump2version trufflehog3\n```\n\n### Tests\n\nTo run tests:\n\n```bash\nbundle exec rspec\n```\n\n### Documentation\n\nTo generate the documentation locally:\n\n```bash\nbundle exec yard\n```\n\n### Linters\n\nTo run linters:\n\n```bash\nnpx cspell . --dot --gitignore\nbundle exec rubocop\ntrufflehog3 --no-history\n```\n\n### Formatters\n\nTo run formatters:\n\n```bash\nprettier . --write\n```\n\n## Contributing\n\nPlease read this repository's [Code of Conduct](CODE_OF_CONDUCT.md) which outlines our collaboration standards and the [Changelog](CHANGELOG.md) for details on breaking changes that have been made.\n\nThis repository adheres to semantic versioning standards. For more information on semantic versioning visit [SemVer](https://semver.org).\n\nBump2version is used to version and tag changes. For example:\n\n```bash\nbump2version patch\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flewagon%2Fwait-on-check-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flewagon%2Fwait-on-check-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flewagon%2Fwait-on-check-action/lists"}