6464
6565 - name : Get latest commit hash from master
6666 id : latest_commit
67+ shell : bash
6768 run : |
6869 git fetch origin master
6970 latest_commit=$(git rev-parse origin/master)
7374 env :
7475 LATEST_COMMIT : ${{ steps.latest_commit.outputs.latest_commit }}
7576 id : artifact_check
77+ shell : bash
7678 run : |
7779 ARTIFACT_EXISTS=$(curl -s -H "Authorization: Bearer ${{ github.token }}" "https://api.github.com/repos/${{ github.repository }}/actions/artifacts?name=reports-$LATEST_COMMIT" | jq '.total_count' | awk '{print $1}')
7880 if [[ $ARTIFACT_EXISTS -gt 0 ]]; then
8486 - name : Get artifact URL
8587 id : get_artifact_url
8688 env :
89+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN ]}
8790 LATEST_COMMIT : ${{ steps.latest_commit.outputs.latest_commit }}
91+ shell : bash
8892 run : |
89- ARTIFACT_URL=$(curl -s -H "Authorization: Bearer ${{ secrets. GITHUB_TOKEN }} " \
93+ ARTIFACT_URL=$(curl -s -H "Authorization: Bearer $GITHUB_TOKEN" \
9094 "https://api.github.com/repos/${{ github.repository }}/actions/artifacts?name=reports-${LATEST_COMMIT}" | \
9195 jq -r '.artifacts[0].archive_download_url')
9296 echo "artifact_url=$ARTIFACT_URL" >> $GITHUB_OUTPUT
9599 if : steps.get_artifact_url.outputs.artifact_url != 'null'
96100 env :
97101 ARTIFACT_URL : ${{ steps.get_artifact_url.outputs.artifact_url }}
98- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
102+ GITHUB_TOKEN : ${{ inputs.GITHUB_TOKEN }}
103+ shell : bash
99104 run : |
100105 curl -L -H "Authorization: Bearer $GITHUB_TOKEN" \
101106 "$ARTIFACT_URL" \
@@ -124,12 +129,13 @@ runs:
124129 REF_NAME : ${{ inputs.REF_NAME }}
125130 REMOTE_CONFIG_URL : ${{ inputs.REMOTE_CONFIG_URL }}
126131 NODE_OPTIONS : " --max_old_space_size=4096"
127- run : npm run build:prod && npm run analyze:stats && npm run analyze:build
128132 shell : bash
133+ run : npm run build:prod && npm run analyze:stats && npm run analyze:build
129134
130135 - name : Compare report to master
131136 id : diff
132137 if : steps.get_artifact_url.outputs.artifact_url != 'null'
138+ shell : bash
133139 run : |
134140 DIFF_OUTPUT=$(node .github/workflows/compareReports.js)
135141 echo "diff_output<<EOF" >> $GITHUB_OUTPUT
@@ -152,9 +158,9 @@ runs:
152158 });
153159
154160 - name : Zip all report.json files
161+ shell : bash
155162 run : |
156163 zip -r reports.zip packages/*/report.json
157- shell : bash
158164
159165 - name : Upload reports.zip
160166 uses : actions/upload-artifact@v4
0 commit comments