Skip to content

Commit 7bf8c52

Browse files
Kocalsblondeau
authored andcommitted
Minor adjustments after symfony#2269
1 parent 792d080 commit 7bf8c52

File tree

2 files changed

+31
-7
lines changed

2 files changed

+31
-7
lines changed

.github/workflows/dist-files-size-diff-comment.yaml

+16-4
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,25 @@ jobs:
1010
dist-files-size-diff:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- name: Download artifact
13+
- name: Download dist-size-diff artifact
1414
uses: actions/download-artifact@v4
1515
with:
16-
name: dist-size-${{ github.event.number }}
16+
name: dist-size-diff
17+
run-id: ${{ github.event.workflow_run.id }}
18+
19+
- name: Download pr-number artifact
20+
uses: actions/download-artifact@v4
21+
with:
22+
name: pr-number
23+
run-id: ${{ github.event.workflow_run.id }}
24+
25+
- name: Read pr-number artifact to env var
26+
id: read-pr-number
27+
run: |
28+
echo "::set-output name=pr-number::$(cat ./pr-number)"
1729
1830
- name: Comment on the pull request (if success)
19-
if: ${{ always() && steps.diff.conclusion == 'success' }}
2031
uses: marocchino/sticky-pull-request-comment@v2
2132
with:
22-
path: ./dist-size.md
33+
number: ${{ steps.read-pr-number.outputs.pr-number }}
34+
path: ./dist-size-diff.md

.github/workflows/dist-files-size-diff.yaml

+15-3
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,22 @@ jobs:
5959
const diff = await main()
6060
console.log(diff);
6161
62-
fs.writeFileSync(process.env.GITHUB_WORKSPACE + '/dist-size.md', diff)
62+
fs.writeFileSync(process.env.GITHUB_WORKSPACE + '/dist-size-diff.md', diff)
6363
6464
- name: Upload the diff
6565
uses: actions/upload-artifact@v4
6666
with:
67-
name: dist-size-${{ github.event.number }}
68-
path: ./dist-size.md
67+
name: dist-size-diff
68+
path: ./dist-size-diff.md
69+
70+
- name: Save PR number
71+
env:
72+
PR_NUMBER: ${{ github.event.number }}
73+
run: |
74+
echo $PR_NUMBER > ./pr-number
75+
76+
- name: Upload the PR number
77+
uses: actions/upload-artifact@v4
78+
with:
79+
name: pr-number
80+
path: ./pr-number

0 commit comments

Comments
 (0)