track bundle size with github token bot #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Bundle Size | |
on: | |
pull_request: | |
branches: | |
- main | |
jobs: | |
bundle-size: | |
name: Report bundle size | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Bun | |
uses: oven-sh/setup-bun@v1 | |
with: | |
bun-version: latest | |
- name: Install dependencies | |
run: bun install | |
- name: Build | |
run: bun run build | |
- name: Get bundle size | |
id: size | |
run: | | |
echo "dist=$(du -sh dist | cut -f1)" >> $GITHUB_OUTPUT | |
- name: Update comment | |
uses: marocchino/sticky-pull-request-comment@v2 | |
with: | |
GITHUB_TOKEN: ${{ secrets.TSCIRCUIT_BOT_GITHUB_TOKEN }} | |
header: Bundle Size | |
message: | | |
Bundle `dist` size: ${{ steps.size.outputs.dist }} |