Giter VIP home page Giter VIP logo

wait-for-workflows-action's Introduction

wait-for-workflows-action ts

This is an action to wait for all workflow runs of the current SHA.

Purpose

When any workflow has paths filter in GitHub Actions, we cannot enable the status check in a branch protection rule.

This action aggregates the statuses of workflow runs.

Getting Started

To wait for all workflow runs of the current pull request,

name: wait-for-workflows

on:
  pull_request:

jobs:
  wait-for-workflows:
    runs-on: ubuntu-latest
    timeout-minutes: 30
    steps:
      - uses: int128/wait-for-workflows-action@v1

Enable a status check

You can set up a branch protection rule with the status check of wait-for-workflows. For example,

image

Therefore, a pull request status looks like:

image

How it works

This action fetches the workflow runs against the current commit SHA. It determines the rollup state as follows:

  • If any workflow run is failing, this action exits with an error.
  • If all workflow runs are completed, this action exits successfully.
  • Otherwise, check again.

It excludes the workflow of self to prevent an infinite loop.

It filters the workflows by the current event such as push or pull_request.

Exclude or filter workflows by name patterns

By default, this action evaluates all workflow runs. You can exclude workflow runs by glob name patterns.

jobs:
  wait-for-workflows:
    runs-on: ubuntu-latest
    timeout-minutes: 30
    steps:
      - uses: int128/wait-for-workflows-action@v1
        with:
          exclude-workflow-names: |
            * / generate-graphql

You can also filter workflow runs by glob name patterns.

jobs:
  wait-for-backend-ci:
    runs-on: ubuntu-latest
    timeout-minutes: 30
    steps:
      - uses: int128/wait-for-workflows-action@v1
        with:
          filter-workflow-names: |
            backend / *

Caveat

Cost of GitHub-hosted runners ๐Ÿ’ฐ

This action runs until all workflows are completed. It may increase the cost of GitHub-hosted runners. If your repository is private, it is strongly recommended to use your self-hosted runners.

GitHub API rate limit

This action calls the GitHub GraphQL API until all workflows are completed. It is recommended to use a token of GitHub App or PAT, instead of the default GITHUB_TOKEN. See rate limiting for details.

Specification

Inputs

Name Default Description
initial-delay-seconds 10 Initial delay before polling
period-seconds 15 Polling period
filter-workflow-events github.event_name Filter workflows by events
exclude-workflow-names - Exclude workflows by name patterns
filter-workflow-names - Filter workflows by name patterns
sha github.event.pull_request.head.sha or github.sha Commit SHA to wait for
token github.token GitHub token

Outputs

Name Description
rollup-state Either SUCCESS or FAILURE
failed-workflow-names List of failed workflow names

wait-for-workflows-action's People

Contributors

int128 avatar renovate[bot] avatar roryq avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

wait-for-workflows-action's Issues

Cancelled workflows are handled as a success

When cancelling a workflow that the action is waiting for to finish, the output message is listed as:

COMPLETED: CANCELLED

But the result of the job is successful.

It would be nice to have an option to fail the action, if the status of the workflow is not success

Unable to find version `v1` documentation breaked

It seems that the action is not reachable; I have followed the ./readme.md.

  wait-for-workflows:
    runs-on: ubuntu-latest
    timeout-minutes: 30
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - uses: int128/wait-for-workflows-action@v1
        with:
          token: ${{ secrets.PAT }}
Current runner version: '2.311.0'
Operating System
Runner Image
Runner Image Provisioner
GITHUB_TOKEN Permissions
Secret source: Actions
Prepare workflow directory
Prepare all required actions
Getting action download info
Error: Unable to resolve action `int1[2](https://github.com/vincent-herlemont/struct_db_private/actions/runs/7307452728/job/19913167545#step:1:2)8/wait-for-workflows-action@v1`, unable to find version `v1`

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/release.yaml
  • actions/checkout v4.1.7@692973e3d937129bcbf40652eb9f2f61becf3332
  • actions/setup-node v4.0.3@1e60f620b9541d16bece96c5465dc8ee9832be0b
  • int128/release-typescript-action v1.29.0@ea9cfae1900a4473a9e3efe8f6ba1822140d1229
.github/workflows/ts.yaml
  • actions/checkout v4.1.7@692973e3d937129bcbf40652eb9f2f61becf3332
  • actions/setup-node v4.0.3@1e60f620b9541d16bece96c5465dc8ee9832be0b
  • actions/checkout v4.1.7@692973e3d937129bcbf40652eb9f2f61becf3332
  • actions/setup-node v4.0.3@1e60f620b9541d16bece96c5465dc8ee9832be0b
  • int128/update-generated-files-action v2.52.0@d01a193ae8a14d7d7699981665a0922bde444389
.github/workflows/wait-for-workflows.yaml
  • actions/checkout v4.1.7@692973e3d937129bcbf40652eb9f2f61becf3332
  • actions/setup-node v4.0.3@1e60f620b9541d16bece96c5465dc8ee9832be0b
npm
package.json
  • @actions/core 1.10.1
  • @actions/exec 1.1.1
  • @actions/github 6.0.0
  • @octokit/plugin-retry 7.1.1
  • @types/minimatch 5.1.2
  • graphql 16.9.0
  • minimatch 10.0.1
  • @graphql-codegen/cli 5.0.2
  • @graphql-codegen/import-types-preset 3.0.0
  • @graphql-codegen/typescript 4.0.9
  • @graphql-codegen/typescript-operations 4.2.3
  • @octokit/graphql-schema 15.25.0
  • @tsconfig/node20 20.1.4
  • @types/jest 29.5.12
  • @types/node 20.16.5
  • @vercel/ncc 0.38.1
  • eslint 9.10.0
  • eslint-plugin-jest 28.8.3
  • jest 29.7.0
  • prettier 3.3.3
  • ts-jest 29.2.5
  • typescript 5.6.2
  • typescript-eslint 8.5.0
  • node 20.x
  • pnpm 9.10.0
regex
action.yaml
  • node 20
.github/workflows/release.yaml
  • node 20
.github/workflows/ts.yaml
  • node 20
  • node 20
.github/workflows/wait-for-workflows.yaml
  • node 20

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.