Skip to content

Commit

Permalink
Minor adjustments after #2269
Browse files Browse the repository at this point in the history
  • Loading branch information
Kocal committed Nov 3, 2024
1 parent 137fd2c commit 93d08d0
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 7 deletions.
20 changes: 16 additions & 4 deletions .github/workflows/dist-files-size-diff-comment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,25 @@ jobs:
dist-files-size-diff:
runs-on: ubuntu-latest
steps:
- name: Download artifact
- name: Download dist-size-diff artifact
uses: actions/download-artifact@v4
with:
name: dist-size-${{ github.event.number }}
name: dist-size-diff
run-id: ${{ github.event.workflow_run.id }}

- name: Download pr-number artifact
uses: actions/download-artifact@v4
with:
name: pr-number
run-id: ${{ github.event.workflow_run.id }}

- name: Read pr-number artifact to env var
id: read-pr-number
run: |
echo "::set-output name=pr-number::$(cat ./pr-number)"
- name: Comment on the pull request (if success)
if: ${{ always() && steps.diff.conclusion == 'success' }}
uses: marocchino/sticky-pull-request-comment@v2
with:
path: ./dist-size.md
number: ${{ steps.read-pr-number.outputs.pr-number }}
path: ./dist-size-diff.md
18 changes: 15 additions & 3 deletions .github/workflows/dist-files-size-diff.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,22 @@ jobs:
const diff = await main()
console.log(diff);
fs.writeFileSync(process.env.GITHUB_WORKSPACE + '/dist-size.md', diff)
fs.writeFileSync(process.env.GITHUB_WORKSPACE + '/dist-size-diff.md', diff)
- name: Upload the diff
uses: actions/upload-artifact@v4
with:
name: dist-size-${{ github.event.number }}
path: ./dist-size.md
name: dist-size-diff
path: ./dist-size-diff.md

- name: Save PR number
env:
PR_NUMBER: ${{ github.event.number }}
run: |
echo $PR_NUMBER > ./pr-number
- name: Upload the PR number
uses: actions/upload-artifact@v4
with:
name: pr-number
path: ./pr-number

0 comments on commit 93d08d0

Please sign in to comment.