Skip to content

GitHub Action: Compose multiple (conditional) checks into a single check based on file paths in a pull request

License

Notifications You must be signed in to change notification settings

blend/require-conditional-status-checks

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

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub Action: Require Conditional Status Checks

Example Usage

---
name: 'Meta Workflow: Require Conditional Status Checks'

on:
  pull_request:
    branches:
    - main

jobs:
  meta:
    runs-on:
    - ubuntu-20.04

    steps:
    - name: Ensure All Conditional Checks Have Passed
      uses: blend/require-conditional-status-checks@2022.02.04
      with:
        interval: 20s
        checks-yaml: |
          - job: unit-test-go-core
            paths:
            - cmd/**
            - pkg/**
          - job: lint-go
          - job: protobuf-check-generated
            paths:
            - proto/**
            - pkg/protogen/**
          - job: lint-protobuf
            paths:
            - proto/**

Alternatively, the checks-yaml can be checked into a file in your repository

# ...
    steps:
    - name: Ensure All Conditional Checks Have Passed
      uses: blend/require-conditional-status-checks@2022.02.04
      with:
        interval: 20s
        checks-filename: .github/monorepo/required-checks.yml
# ...

See It In Action

From a recent workflow run on public GitHub:

Example Workflow Public

From a recent workflow on GitHub Enterprise:

Example Workflow GHE

Limitations

  • The GitHub CompareCommits() API can return at most 300 files when comparing two commits. This makes it impossible to determine the full list of impacted files for PRs with 300 or more files. The list of files is critical for blend/require-conditional-status-checks to determine which checks to enforce.

Development

This GitHub Action is developed in the development branch of this repository, in particular via the command in cmd/requireconditional/.

The documentation and source code for this action are maintained there. This branch is intended to be as small as possible so it can be loaded quickly when new jobs retrieve it when spawned as part of a GitHub Actions workflow. For more information on how this GitHub Action is developed, see the DEVELOPMENT document.

About

GitHub Action: Compose multiple (conditional) checks into a single check based on file paths in a pull request

Resources

License

Stars

Watchers

Forks

Packages

No packages published