Files
effect/.github/workflows/bundle-comment.yml
T
2025-05-02 17:06:00 +12:00

57 lines
1.6 KiB
YAML

name: Bundle Size Comment
on:
workflow_run:
workflows: ["Check"]
types:
- completed
permissions: {}
jobs:
comment:
name: Bundle
if: github.event.workflow_run.event == 'pull_request'
runs-on: ubuntu-latest
permissions:
actions: read
pull-requests: write
timeout-minutes: 1
steps:
- name: Download Artifact
uses: actions/download-artifact@v4
with:
run-id: ${{ github.event.workflow_run.id }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Get stats
id: stats
run: |
{
echo 'stats<<EOF'
cat artifact/stats.txt
echo EOF
} >> $GITHUB_OUTPUT
- name: Find Comment
id: find-comment
uses: peter-evans/find-comment@v3
with:
issue-number: ${{ github.event.workflow_run.pull_requests[0].number }}
comment-author: "github-actions[bot]"
body-includes: <!-- This comment was auto-generated by GitHub Actions to display bundle size statistics -->
- name: Create Comment
id: comment
uses: peter-evans/create-or-update-comment@v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BUNDLE_STATS: "${{ steps.stats.outputs.stats }}"
with:
comment-id: ${{ steps.find-comment.outputs.comment-id }}
issue-number: ${{ github.event.workflow_run.pull_requests[0].number }}
edit-mode: replace
body: |
<!-- This comment was auto-generated by GitHub Actions to display bundle size statistics -->
## Bundle Size Analysis
${{ env.BUNDLE_STATS }}