|
1 |
| -# GitHub Action: Composite |
| 1 | +# GitHub Action: Require Conditional Status Checks |
2 | 2 |
|
3 |
| -This GitHub Action is developed in the `development` [branch][1] of this |
4 |
| -repository, in particular via the command in `cmd/composite/`. |
| 3 | +## Example Usage |
| 4 | + |
| 5 | +```yaml |
| 6 | +--- |
| 7 | +name: 'Meta Workflow: Require Conditional Status Checks' |
| 8 | + |
| 9 | +on: |
| 10 | + pull_request: |
| 11 | + branches: |
| 12 | + - main |
| 13 | + |
| 14 | +jobs: |
| 15 | + meta: |
| 16 | + runs-on: |
| 17 | + - ubuntu-20.04 |
| 18 | + |
| 19 | + steps: |
| 20 | + - name: Ensure All Conditional Checks Have Passed |
| 21 | + |
| 22 | + with: |
| 23 | + interval: 20s |
| 24 | + checks-yaml: | |
| 25 | + - job: unit-test-go-core |
| 26 | + paths: |
| 27 | + - cmd/** |
| 28 | + - pkg/** |
| 29 | + - job: lint-go |
| 30 | + - job: protobuf-check-generated |
| 31 | + paths: |
| 32 | + - proto/** |
| 33 | + - pkg/protogen/** |
| 34 | + - job: lint-protobuf |
| 35 | + paths: |
| 36 | + - proto/** |
| 37 | +``` |
| 38 | +
|
| 39 | +Alternatively, the `checks-yaml` can be checked into a file in your repository |
| 40 | + |
| 41 | +```yaml |
| 42 | +# ... |
| 43 | + steps: |
| 44 | + - name: Ensure All Conditional Checks Have Passed |
| 45 | + |
| 46 | + with: |
| 47 | + interval: 20s |
| 48 | + checks-filename: .github/monorepo/required-checks.yml |
| 49 | +# ... |
| 50 | +``` |
| 51 | + |
| 52 | +## See It In Action |
| 53 | + |
| 54 | +From a recent workflow run on public GitHub: |
| 55 | + |
| 56 | +![Example Workflow Public][2] |
| 57 | + |
| 58 | +From a recent workflow on GitHub Enterprise: |
| 59 | + |
| 60 | +![Example Workflow GHE][3] |
| 61 | + |
| 62 | +## Limitations |
| 63 | + |
| 64 | +- The GitHub `CompareCommits()` [API][1] can return at most 300 files |
| 65 | + when comparing two commits. This makes it impossible to determine the |
| 66 | + full list of impacted files for PRs with 300 or more files. The list |
| 67 | + of files is critical for `blend/require-conditional-status-checks` to determine which |
| 68 | + checks to enforce. |
| 69 | + |
| 70 | +## Development |
| 71 | + |
| 72 | +This GitHub Action is developed in the `development` [branch][5] of this |
| 73 | +repository, in particular via the command in `cmd/requireconditional/`. |
5 | 74 |
|
6 | 75 | The documentation and source code for this action are maintained there. This
|
7 | 76 | branch is intended to be as small as possible so it can be loaded quickly
|
8 | 77 | when new jobs retrieve it when spawned as part of a GitHub Actions workflow.
|
| 78 | +For more information on how this GitHub Action is developed, see the |
| 79 | +[DEVELOPMENT][4] document. |
9 | 80 |
|
10 |
| -[1]: https://github.com/blend/action-composite/tree/7586da331a1ce003a321cc16ac72319d78c7764b |
| 81 | +[1]: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#compare-two-commits |
| 82 | +[2]: https://github.com/blend/require-conditional-status-checks/blob/070363af576e7c117f8f331c6cc11c53c047873a/_images/example-run-public.png?raw=true |
| 83 | +[3]: https://github.com/blend/require-conditional-status-checks/blob/070363af576e7c117f8f331c6cc11c53c047873a/_images/example-run-ghe.png?raw=true |
| 84 | +[4]: https://github.com/blend/require-conditional-status-checks/blob/070363af576e7c117f8f331c6cc11c53c047873a/DEVELOPMENT.md |
| 85 | +[5]: https://github.com/blend/require-conditional-status-checks/tree/070363af576e7c117f8f331c6cc11c53c047873a |
0 commit comments