https://github.com/blend/require-conditional-status-checks
GitHub Action: Compose multiple (conditional) checks into a single check based on file paths in a pull request
https://github.com/blend/require-conditional-status-checks
Last synced: 2 months ago
JSON representation
GitHub Action: Compose multiple (conditional) checks into a single check based on file paths in a pull request
- Host: GitHub
- URL: https://github.com/blend/require-conditional-status-checks
- Owner: blend
- License: apache-2.0
- Created: 2021-11-19T04:06:26.000Z (about 4 years ago)
- Default Branch: release
- Last Pushed: 2022-07-05T19:16:56.000Z (over 3 years ago)
- Last Synced: 2024-10-14T13:34:12.346Z (about 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 35.9 MB
- Stars: 28
- Watchers: 45
- Forks: 6
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GitHub Action: Require Conditional Status Checks
## Example Usage
```yaml
---
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
```yaml
# ...
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][2]
From a recent workflow on GitHub Enterprise:
![Example Workflow GHE][3]
## Limitations
- The GitHub `CompareCommits()` [API][1] 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][5] 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][4] document.
[1]: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#compare-two-commits
[2]: https://github.com/blend/require-conditional-status-checks/blob/4b7de504558cac5083795023fe26985549ef6e0b/_images/example-run-public.png?raw=true
[3]: https://github.com/blend/require-conditional-status-checks/blob/4b7de504558cac5083795023fe26985549ef6e0b/_images/example-run-ghe.png?raw=true
[4]: https://github.com/blend/require-conditional-status-checks/blob/4b7de504558cac5083795023fe26985549ef6e0b/DEVELOPMENT.md
[5]: https://github.com/blend/require-conditional-status-checks/tree/4b7de504558cac5083795023fe26985549ef6e0b