-
Notifications
You must be signed in to change notification settings - Fork 1
53 lines (47 loc) · 1.45 KB
/
build-changed-packs.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
name: Build changed packs
on:
push:
paths: packs/*.json
branches: main
jobs:
skip-duplicates:
runs-on: ubuntu-latest
steps:
- uses: fkirc/skip-duplicate-actions@master
with:
github_token: ${{ github.token }}
list-changed-packs:
needs: skip-duplicates
name: List changed packs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Detect changed pack definitions
- uses: dorny/paths-filter@v2
id: filter
with:
list-files: shell
filters: |
changed:
- added|modified: 'packs/*.json'
# Convert paths into a list of pack IDs
- id: set-matrix
if: ${{ steps.filter.outputs.changed == 'true' }}
name: Set matrix with basenames of changed paths
# Run basename on the list of changed files then convert the list to
# JSON
run: echo "matrix=$(basename -s .json ${{ steps.filter.outputs.changed_files }} | jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_OUTPUT
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
build-packs:
name: Build packs
needs: list-changed-packs
if: ${{ needs.list-changed-packs.outputs.matrix }}
strategy:
fail-fast: false
matrix:
pack: ${{ fromJson(needs.list-changed-packs.outputs.matrix) }}
uses: kueda/underfoot/.github/workflows/build-pack.yml@main
with:
pack: ${{ matrix.pack }}
secrets: inherit