-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (52 loc) · 1.47 KB
/
test.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
name: Test
on:
workflow_run:
workflows:
- Dummy
types:
- requested
- completed
permissions:
pull-requests: write
concurrency:
group: ${{ github.workflow }}-${{ github.event.workflow_run.pull_requests[0].number || 'unknown' }}
cancel-in-progress: true
jobs:
reusable-workflow:
if: github.event.workflow_run.pull_requests[0]
uses: ./.github/workflows/comment.yml
matrix:
if: github.event.workflow_run.pull_requests[0]
runs-on: ubuntu-latest
outputs:
templates: ${{ steps.matrix.outputs.templates }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.workflow_run.head_sha }}
- id: matrix
run: |
ls | \
xargs -I {} basename -s .md {} | \
jq -R '[.]' | \
jq -sc add | \
xargs -I {} -0 echo "templates={}" | \
tee -a $GITHUB_OUTPUT
working-directory: templates
action:
needs: [matrix]
if: github.event.workflow_run.pull_requests[0]
runs-on: ubuntu-latest
strategy:
matrix:
template: ${{fromJson(needs.matrix.outputs.templates)}}
fail-fast: false
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.workflow_run.head_sha }}
path: sorted-pr-checks
- uses: ./sorted-pr-checks
with:
template: ${{ matrix.template }}
identifier: ${{ github.workflow }}-${{ github.job }}-${{ matrix.template }}