Skip to content

Commit 35f549f

Browse files
committed
Use a matrix
1 parent 48ee8ab commit 35f549f

1 file changed

Lines changed: 20 additions & 9 deletions

File tree

.github/workflows/list-changed-files.yml

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,26 @@ permissions: {}
2929

3030
jobs:
3131
changed-files:
32-
name: Generate changed file list
32+
name: ${{ matrix.description }} files between tags ${{ matrix.old_tag }} and ${{ matrix.new_tag }}
3333
runs-on: 'ubuntu-24.04'
3434
permissions:
3535
contents: read
3636
if: ${{ github.repository == 'WordPress/wordpress-develop' || true }}
37+
strategy:
38+
matrix:
39+
new_tag: '6.8.0'
40+
old_tag: '6.7.3'
41+
pattern: [ 'A', 'D', 'M', 'R' ]
42+
43+
include:
44+
- pattern: 'A'
45+
description: 'Added'
46+
- pattern: 'D'
47+
description: 'Deleted'
48+
- pattern: 'M'
49+
description: 'Modified'
50+
- pattern: 'R'
51+
description: 'Renamed'
3752

3853
steps:
3954
- name: Checkout repository
@@ -44,14 +59,10 @@ jobs:
4459
fetch-depth: 0
4560
persist-credentials: false
4661

47-
- name: List added files
48-
run: echo "$(git diff --name-status 6.7.3...6.8.0 | grep -E '^(A)' | cut -c3-)" >> $GITHUB_STEP_SUMMARY
49-
50-
- name: List deleted files
51-
run: echo "$(git diff --name-status 6.7.3...6.8.0 | grep -E '^(D)' | cut -c3-)" >> $GITHUB_STEP_SUMMARY
52-
53-
- name: List modified files
54-
run: echo "$(git diff --name-status 6.7.3...6.8.0 | grep -E '^(M)' | cut -c3-)" >> $GITHUB_STEP_SUMMARY
62+
- name: Generate file list
63+
env:
64+
PATTERN: ${{ matrix.pattern }}
65+
run: echo "$(git diff --name-status 6.7.3...6.8.0 | grep -E '^($PATTERN)' | cut -c3-)" >> $GITHUB_STEP_SUMMARY
5566

5667
slack-notifications:
5768
name: Slack Notifications

0 commit comments

Comments
 (0)