-
Notifications
You must be signed in to change notification settings - Fork 160
62 lines (57 loc) · 2.33 KB
/
docs-required-override.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# This workflow is triggered by changes on the documentation. Normally, if only documentation is modified, the required Forest checks are not triggered which makes it impossible to merge the PR. See <https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/troubleshooting-required-status-checks#handling-skipped-but-required-checks>. The workaround is to provide no-op jobs that are triggered by the same events as the docs-check job. This way, the "required checks" are passing and the PR can be merged.
name: Docs Required Override
concurrency:
group: '${{ github.workflow }}-${{ github.ref }}'
cancel-in-progress: '${{ github.ref != ''refs/heads/main'' }}'
on:
workflow_dispatch:
merge_group:
pull_request:
branches:
- main
paths:
- '**.md'
- 'docs/**'
- '.github/workflows/docs-check.yml'
- '.github/workflows/docs-required-override.yml'
push:
branches:
- main
paths:
- '**.md'
- 'docs/**'
- '.github/workflows/docs-check.yml'
- '.github/workflows/docs-required-override.yml'
jobs:
# We need this because merge groups dont support path filters
# https://github.com/community/community/discussions/45899
changes:
name: Determine if we need to run the workflow
runs-on: ubuntu-latest
outputs:
changesFound: ${{ steps.filter.outputs.changesFound }}
otherChangesFound: ${{ steps.filter.outputs.otherChangesFound }}
steps:
- name: Checkout source code
uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
changesFound:
- 'docs/**'
- '**.md'
- '.github/workflows/docs-check.yml'
- '.github/workflows/docs-required-override.yml'
otherChangesFound:
- '!docs/**'
- '!**.md'
- '!.github/workflows/docs-check.yml'
- '!.github/workflows/docs-required-override.yml'
test:
name: Calibnet check
runs-on: ubuntu-latest
needs: changes
if: ${{ needs.changes.outputs.changesFound == 'true' && needs.changes.outputs.otherChangesFound == 'false' }}
steps:
- run: echo "No-op job to trigger the required checks"