Drop --paginate from nightly marker lookup
With --paginate, gh runs the jq aggregation per page and concatenates, so sort_by | last ran per-page and extra workflow_dispatch runs could push past per_page=100 and emit two URLs — which would break the curl download. The artifacts API returns results newest-first, so the most recent marker is always on page 1. Drop --paginate and take first(non-expired), which emits exactly one URL (or none) by construction. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -35,10 +35,13 @@ jobs:
|
|||||||
GH_TOKEN: ${{ github.token }}
|
GH_TOKEN: ${{ github.token }}
|
||||||
run: |
|
run: |
|
||||||
# Find the most recent non-expired nightly-build-commit artifact and read its SHA
|
# Find the most recent non-expired nightly-build-commit artifact and read its SHA
|
||||||
|
# The artifacts API returns results newest-first, so the most recent marker is on
|
||||||
|
# page 1 — no --paginate needed (which would run the jq aggregation per page and
|
||||||
|
# could emit multiple URLs). Take the first non-expired match.
|
||||||
prev=""
|
prev=""
|
||||||
url=$(gh api --paginate \
|
url=$(gh api \
|
||||||
"repos/${GITHUB_REPOSITORY}/actions/artifacts?name=nightly-build-commit&per_page=100" \
|
"repos/${GITHUB_REPOSITORY}/actions/artifacts?name=nightly-build-commit&per_page=100" \
|
||||||
--jq '[.artifacts[] | select(.expired == false)] | sort_by(.created_at) | last | .archive_download_url' \
|
--jq 'first(.artifacts[] | select(.expired == false)) | .archive_download_url' \
|
||||||
2>/dev/null || true)
|
2>/dev/null || true)
|
||||||
if [ -n "$url" ] && [ "$url" != "null" ]; then
|
if [ -n "$url" ] && [ "$url" != "null" ]; then
|
||||||
if curl -sSL -H "Authorization: Bearer $GH_TOKEN" -o marker.zip "$url" \
|
if curl -sSL -H "Authorization: Bearer $GH_TOKEN" -o marker.zip "$url" \
|
||||||
|
|||||||
Reference in New Issue
Block a user