Skip to content

Commit 0613400

Browse files
authored
ci: bundle size preview (#8577)
* ci: bundle size preview * chore: syntax * fix: markdown syntax for images * fix: use github event number over sha * fix: fix main link * chore: format message * fix: make preview bundle size part of the preview step * fix: proper links * fix: back to github.sha * fix: determine correct commit SHA * ok
1 parent 12d4542 commit 0613400

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

.github/workflows/pr.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ env:
1414

1515
permissions:
1616
contents: read
17+
pull-requests: write
1718

1819
jobs:
1920
test:
@@ -57,3 +58,16 @@ jobs:
5758
run: pnpm run build:all
5859
- name: Publish Previews
5960
run: pnpx pkg-pr-new publish --pnpm --compact './packages/*' --template './examples/*/*'
61+
- name: Determine commit SHA
62+
id: determine-sha
63+
run: |
64+
echo "COMMIT_SHA=${{ github.event.pull_request.head.sha || github.sha }}" >> $GITHUB_ENV
65+
- name: Preview Bundle Size
66+
uses: marocchino/sticky-pull-request-comment@52423e01640425a022ef5fd42c6fb5f633a02728
67+
with:
68+
message: |
69+
Sizes for commit ${{ env.COMMIT_SHA }}:
70+
| Branch | Bundle Size |
71+
|--------|--------|
72+
| Main | [![](https://deno.bundlejs.com/badge?q=https://esm.sh/@tanstack/react-query/es2022/react-query.mjs&config={%22esbuild%22:{%22external%22:[%22react@^19.0.0/jsx-runtime?target=es2022%22,%22react@^19.0.0?target=es2022%22]}}&badge=detailed)](https://bundlejs.com/?q=https://esm.sh/@tanstack/react-query/es2022/react-query.mjs&config=%7B%22esbuild%22:%7B%22external%22:%5B%22react@%5E19.0.0/jsx-runtime?target=es2022%22,%22react@%5E19.0.0?target=es2022%22%5D%7D%7D) |
73+
| This PR | [![](https://deno.bundlejs.com/badge?q=https://esm.sh/pr/@tanstack/react-query@${{ env.COMMIT_SHA }}/es2022/react-query.mjs&config={%22esbuild%22:{%22external%22:[%22react@^19.0.0/jsx-runtime?target=es2022%22,%22react@^19.0.0?target=es2022%22]}}&badge=detailed)](https://bundlejs.com/?q=https://esm.sh/pr/@tanstack/react-query@${{ env.COMMIT_SHA }}/es2022/react-query.mjs&config=%7B%22esbuild%22:%7B%22external%22:%5B%22react@%5E19.0.0/jsx-runtime?target=es2022%22,%22react@%5E19.0.0?target=es2022%22%5D%7D%7D) |

0 commit comments

Comments
 (0)