Giter Club home page Giter Club 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 workflows

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

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 specified workflows
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

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

wait-for-workflows-action's Issues

Dependency Dashboard

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

Repository problems

These problems occurred while renovating this repository. View logs.

  • WARN: File contents are invalid JSON but parse using JSON5. Support for this will be removed in a future release so please change to a support .json5 file name or ensure correct JSON syntax.

This repository currently has no open or pending branches.

Detected dependencies

github-actions
.github/workflows/release.yaml
  • actions/checkout v4.1.1@b4ffde65f46336ab88eb53be808477a3936bae11
  • actions/setup-node v4.0.0@8f152de45cc393bb48ce5d89d36b731f54556e65
  • int128/release-typescript-action v1.27.0@94c45715849473c37ebdc66190c9ec4c9543e46b
.github/workflows/ts.yaml
  • actions/checkout v4.1.1@b4ffde65f46336ab88eb53be808477a3936bae11
  • actions/setup-node v4.0.0@8f152de45cc393bb48ce5d89d36b731f54556e65
  • actions/checkout v4.1.1@b4ffde65f46336ab88eb53be808477a3936bae11
  • actions/setup-node v4.0.0@8f152de45cc393bb48ce5d89d36b731f54556e65
  • int128/update-generated-files-action v2.46.0@75cb66681c401e4baf3ff82c4137f3dc1e53cc56
.github/workflows/wait-for-workflows.yaml
  • actions/checkout v4.1.1@b4ffde65f46336ab88eb53be808477a3936bae11
  • actions/setup-node v4.0.0@8f152de45cc393bb48ce5d89d36b731f54556e65
npm
package.json
  • @actions/core 1.10.1
  • @actions/exec 1.1.1
  • @actions/github 6.0.0
  • @octokit/plugin-retry 6.0.1
  • @types/minimatch 5.1.2
  • graphql 16.8.1
  • minimatch 9.0.3
  • @graphql-codegen/cli 5.0.0
  • @graphql-codegen/import-types-preset 3.0.0
  • @graphql-codegen/typescript 4.0.1
  • @graphql-codegen/typescript-operations 4.0.1
  • @octokit/graphql-schema 14.44.1
  • @tsconfig/node20 20.1.2
  • @types/jest 29.5.10
  • @types/node 20.10.0
  • @typescript-eslint/eslint-plugin 6.13.1
  • @typescript-eslint/parser 6.13.1
  • @vercel/ncc 0.38.1
  • eslint 8.54.0
  • eslint-plugin-jest 27.6.0
  • jest 29.7.0
  • prettier 3.1.0
  • ts-jest 29.1.1
  • typescript 5.3.2
  • node 20.x
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.