mirror of
https://github.com/Effect-TS/effect.git
synced 2026-12-02 03:15:52 +08:00
57 lines
1.6 KiB
YAML
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 }}
|