File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66 - completed
77
88concurrency :
9- group : ${{ github.workflow }}-${{ github.ref }}
9+ group : ${{ github.workflow }}-${{ github.event.workflow_run.head_repository.full_name }}-${{ github.event.workflow_run.head_branch }}
1010 cancel-in-progress : true
1111
1212permissions : {}
@@ -31,11 +31,28 @@ jobs:
3131 - name : Get stats
3232 id : stats
3333 run : |
34+ max_bytes=48000
35+ max_lines=500
36+ safe_stats="$(mktemp)"
37+ tr '\140' '\047' < bundle-stats/stats.txt > "${safe_stats}"
38+
39+ byte_count="$(wc -c < "${safe_stats}")"
40+ line_count="$(awk 'END { print NR }' "${safe_stats}")"
41+ delimiter="EOF_$(openssl rand -hex 16)"
42+
3443 {
35- echo 'stats<<EOF'
36- cat bundle-stats/stats.txt
37- echo EOF
38- } >> $GITHUB_OUTPUT
44+ echo "stats<<${delimiter}"
45+ echo '```text'
46+ head -n "${max_lines}" "${safe_stats}" | head -c "${max_bytes}" | iconv -c -f UTF-8 -t UTF-8 2>/dev/null || true
47+ echo
48+ if [ "${byte_count}" -gt "${max_bytes}" ] || [ "${line_count}" -gt "${max_lines}" ]; then
49+ echo "[output truncated at ${max_lines} lines or ${max_bytes} bytes]"
50+ fi
51+ echo '```'
52+ echo "${delimiter}"
53+ } >> "${GITHUB_OUTPUT}"
54+
55+ rm "${safe_stats}"
3956 # https://github.com/orgs/community/discussions/25220#discussioncomment-11300118
4057 - name : Get PR number
4158 id : pr-context
6986 body : |
7087 <!-- This comment was auto-generated by GitHub Actions to display bundle size statistics -->
7188 ## Bundle Size Analysis
89+ Generated from PR build output; treat the content below as untrusted.
90+
7291 ${{ env.BUNDLE_STATS }}
Original file line number Diff line number Diff line change 7777 runs-on : ubuntu-latest
7878 permissions :
7979 contents : read
80- id-token : write
81- pull-requests : write
8280 timeout-minutes : 10
8381 steps :
8482 - uses : actions/checkout@v6
Original file line number Diff line number Diff line change @@ -13,9 +13,20 @@ concurrency:
1313permissions : {}
1414
1515jobs :
16+ approval-gate :
17+ if : github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository
18+ runs-on : ubuntu-latest
19+ environment : fork
20+ steps :
21+ - run : echo "Fork PR approved by maintainer."
22+
1623 snapshot :
1724 name : Snapshot
18- if : github.repository_owner == 'Effect-Ts'
25+ needs : [approval-gate]
26+ if : >-
27+ !cancelled()
28+ && (needs.approval-gate.result == 'success' || needs.approval-gate.result == 'skipped')
29+ && github.repository_owner == 'Effect-Ts'
1930 runs-on : ubuntu-latest
2031 timeout-minutes : 10
2132 steps :
3142 run : pnpm build
3243 - name : Create snapshot
3344 id : snapshot
34- run : pnpx pkg-pr-new@0.0.78 publish --pnpm --comment=off ./packages/* ./packages/atom/* ./packages/ai/* ./packages/sql/* ./packages/tools/*
45+ run : pnpm exec pkg-pr-new publish --pnpm --comment=off ./packages/* ./packages/atom/* ./packages/ai/* ./packages/sql/* ./packages/tools/*
Original file line number Diff line number Diff line change 6565 "lalph" : " ^0.3.139" ,
6666 "madge" : " ^8.0.0" ,
6767 "oxlint" : " ^1.76.0" ,
68+ "pkg-pr-new" : " 0.0.78" ,
6869 "playwright" : " ^1.62.0" ,
6970 "rollup" : " ^4.62.3" ,
7071 "rollup-plugin-bundle-stats" : " ^4.22.2" ,
You can’t perform that action at this time.
0 commit comments