File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -173,14 +173,21 @@ jobs:
173
173
-H "Accept: application/vnd.github+json" \
174
174
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
175
175
-H "X-GitHub-Api-Version: 2022-11-28" \
176
- https://api.github.com/repos/${{ github.repository }}/actions/runs?status=success&per_page=1 | \
176
+ " https://api.github.com/repos/${{ github.repository }}/actions/runs?status=success&per_page=1" | \
177
177
jq -r '.workflow_runs[0].id')
178
-
178
+
179
+ echo "LAST_SUCCESSFUL_RUN_ID=$LAST_SUCCESSFUL_RUN_ID" >> $GITHUB_ENV
180
+
181
+ if [ -z "$LAST_SUCCESSFUL_RUN_ID" ]; then
182
+ echo "No successful runs found."
183
+ exit 1
184
+ fi
185
+
179
186
ARTIFACT_IDS=$(curl \
180
187
-H "Accept: application/vnd.github+json" \
181
188
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
182
189
-H "X-GitHub-Api-Version: 2022-11-28" \
183
- https://api.github.com/repos/${{ github.repository }}/actions/runs/" ${LAST_SUCCESSFUL_RUN_ID}" /artifacts | \
190
+ " https://api.github.com/repos/${{ github.repository }}/actions/runs/${LAST_SUCCESSFUL_RUN_ID}/artifacts" | \
184
191
jq -r '.artifacts | sort_by(.created_at) | .[] | select(.name | startswith("testresults-")) | .id')
185
192
186
193
echo "ARTIFACT_IDS=$ARTIFACT_IDS" >> $GITHUB_ENV
You can’t perform that action at this time.
0 commit comments