Skip to content

Commit c900eb4

Browse files
committed
Add missing step for changed files
1 parent 3690000 commit c900eb4

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

.github/workflows/pr.ci.js.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,18 @@ jobs:
1212
steps:
1313
- name: Checkout PR
1414
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
15+
with:
16+
fetch-depth: ${{ github.event_name == 'pull_request' && 2 || 0 }}
17+
18+
- name: Get changed files
19+
id: changed-files
20+
run: |
21+
if ${{ github.event_name == 'pull_request' }}; then
22+
echo "changed_files=$(git diff --name-only --diff-filter=ACM -r HEAD^1 HEAD | xargs)" >> $GITHUB_OUTPUT
23+
else
24+
echo "changed_files=$(git diff --name-only --diff-filter=ACM ${{ github.event.before }} ${{ github.event.after }} | xargs)" >> $GITHUB_OUTPUT
25+
fi
26+
1527
- name: Enable corepack to fix https://github.com/actions/setup-node/pull/901
1628
run: corepack enable pnpm
1729

@@ -37,6 +49,18 @@ jobs:
3749
steps:
3850
- name: Checkout PR
3951
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
52+
with:
53+
fetch-depth: ${{ github.event_name == 'pull_request' && 2 || 0 }}
54+
55+
- name: Get changed files
56+
id: changed-files
57+
run: |
58+
if ${{ github.event_name == 'pull_request' }}; then
59+
echo "changed_files=$(git diff --name-only --diff-filter=ACM -r HEAD^1 HEAD | xargs)" >> $GITHUB_OUTPUT
60+
else
61+
echo "changed_files=$(git diff --name-only --diff-filter=ACM ${{ github.event.before }} ${{ github.event.after }} | xargs)" >> $GITHUB_OUTPUT
62+
fi
63+
4064
- name: Enable corepack to fix https://github.com/actions/setup-node/pull/901
4165
run: corepack enable pnpm
4266

0 commit comments

Comments
 (0)