@@ -44,31 +44,31 @@ jobs:
4444 GZIP_SIZE=$(echo "scale=2; $GZIP_BYTES/1024/1024" | bc)
4545 echo "{\"total\": ${SIZE}, \"gzipped\": ${GZIP_SIZE}}" > /tmp/bundle-stats.json
4646
47- - name : Compare Bundle Stats
48- id : compare
49- uses : actions/github-script@v6
50- env :
51- GITHUB_TOKEN : ${{ secrets.GIST_TOKEN }}
52- with :
53- script : |
54- const gistId = '${{ secrets.BUNDLE_STATS_GIST_ID }}';
55-
56- async function getGistContent() {
57- const { data } = await github.rest.gists.get({
58- gist_id: gistId,
59- headers: {
60- authorization: `token ${process.env.GITHUB_TOKEN}`
61- }
62- });
63- return JSON.parse(data.files['bundle-stats.json'].content || '{}');
64- }
65-
66- const content = await getGistContent();
67- const baseStats = content['${{ github.event.pull_request.base.ref }}'];
68- const newStats = require('/tmp/bundle-stats.json');
69-
70- const comparison = `minecraft.html (normal build gzip)\n${baseStats.total}MB (${baseStats.gzipped}MB compressed) -> ${newStats.total}MB (${newStats.gzipped}MB compressed)`;
71- core.setOutput('stats', comparison);
47+ # - name: Compare Bundle Stats
48+ # id: compare
49+ # uses: actions/github-script@v6
50+ # env:
51+ # GITHUB_TOKEN: ${{ secrets.GIST_TOKEN }}
52+ # with:
53+ # script: |
54+ # const gistId = '${{ secrets.BUNDLE_STATS_GIST_ID }}';
55+
56+ # async function getGistContent() {
57+ # const { data } = await github.rest.gists.get({
58+ # gist_id: gistId,
59+ # headers: {
60+ # authorization: `token ${process.env.GITHUB_TOKEN}`
61+ # }
62+ # });
63+ # return JSON.parse(data.files['bundle-stats.json'].content || '{}');
64+ # }
65+
66+ # const content = await getGistContent();
67+ # const baseStats = content['${{ github.event.pull_request.base.ref }}'];
68+ # const newStats = require('/tmp/bundle-stats.json');
69+
70+ # const comparison = `minecraft.html (normal build gzip)\n${baseStats.total}MB (${baseStats.gzipped}MB compressed) -> ${newStats.total}MB (${newStats.gzipped}MB compressed)`;
71+ # core.setOutput('stats', comparison);
7272
7373 # - run: pnpm tsx scripts/buildNpmReact.ts
7474 - run : nohup pnpm prod-start &
@@ -86,43 +86,43 @@ jobs:
8686 # env:
8787 # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8888
89- - name : Store Bundle Stats
90- if : github.event.pull_request.base.ref == 'next'
91- uses : actions/github-script@v6
92- env :
93- GITHUB_TOKEN : ${{ secrets.GIST_TOKEN }}
94- with :
95- script : |
96- const gistId = '${{ secrets.BUNDLE_STATS_GIST_ID }}';
97-
98- async function getGistContent() {
99- const { data } = await github.rest.gists.get({
100- gist_id: gistId,
101- headers: {
102- authorization: `token ${process.env.GITHUB_TOKEN}`
103- }
104- });
105- return JSON.parse(data.files['bundle-stats.json'].content || '{}');
106- }
107-
108- async function updateGistContent(content) {
109- await github.rest.gists.update({
110- gist_id: gistId,
111- headers: {
112- authorization: `token ${process.env.GITHUB_TOKEN}`
113- },
114- files: {
115- 'bundle-stats.json': {
116- content: JSON.stringify(content, null, 2)
117- }
118- }
119- });
120- }
121-
122- const stats = require('/tmp/bundle-stats.json');
123- const content = await getGistContent();
124- content['${{ github.event.pull_request.base.ref }}'] = stats;
125- await updateGistContent(content);
89+ # - name: Store Bundle Stats
90+ # if: github.event.pull_request.base.ref == 'next'
91+ # uses: actions/github-script@v6
92+ # env:
93+ # GITHUB_TOKEN: ${{ secrets.GIST_TOKEN }}
94+ # with:
95+ # script: |
96+ # const gistId = '${{ secrets.BUNDLE_STATS_GIST_ID }}';
97+
98+ # async function getGistContent() {
99+ # const { data } = await github.rest.gists.get({
100+ # gist_id: gistId,
101+ # headers: {
102+ # authorization: `token ${process.env.GITHUB_TOKEN}`
103+ # }
104+ # });
105+ # return JSON.parse(data.files['bundle-stats.json'].content || '{}');
106+ # }
107+
108+ # async function updateGistContent(content) {
109+ # await github.rest.gists.update({
110+ # gist_id: gistId,
111+ # headers: {
112+ # authorization: `token ${process.env.GITHUB_TOKEN}`
113+ # },
114+ # files: {
115+ # 'bundle-stats.json': {
116+ # content: JSON.stringify(content, null, 2)
117+ # }
118+ # }
119+ # });
120+ # }
121+
122+ # const stats = require('/tmp/bundle-stats.json');
123+ # const content = await getGistContent();
124+ # content['${{ github.event.pull_request.base.ref }}'] = stats;
125+ # await updateGistContent(content);
126126
127127 - name : Update PR Description
128128 uses : actions/github-script@v6
0 commit comments