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:
173173 -H "Accept: application/vnd.github+json" \
174174 -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
175175 -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" | \
177177 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+
179186 ARTIFACT_IDS=$(curl \
180187 -H "Accept: application/vnd.github+json" \
181188 -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
182189 -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" | \
184191 jq -r '.artifacts | sort_by(.created_at) | .[] | select(.name | startswith("testresults-")) | .id')
185192
186193 echo "ARTIFACT_IDS=$ARTIFACT_IDS" >> $GITHUB_ENV
You can’t perform that action at this time.
0 commit comments