Skip to content

Commit a038845

Browse files
authored
sync(ci): add pagination to artifact API calls (#272)
1 parent 9450267 commit a038845

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

.github/actions/download-artifact-resilient/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ runs:
104104
# Fetch artifacts list (best-effort). In some workflow contexts GitHub will
105105
# block listing artifacts via API even though direct downloads work.
106106
# So: if listing fails, we fall back to attempting the download directly.
107-
ARTIFACTS_JSON=$(gh api repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts 2>&1) || {
107+
ARTIFACTS_JSON=$(gh api repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts --paginate 2>&1) || {
108108
API_ERROR=$?
109109
echo "⚠️ Failed to fetch artifacts list (exit code: $API_ERROR)"
110110
echo " Response: $ARTIFACTS_JSON"

.github/workflows/fortress-coverage.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ jobs:
405405
echo ""
406406
echo "🔍 Checking run $run_id for coverage history artifacts..."
407407
408-
ARTIFACTS=$(gh api repos/${{ github.repository }}/actions/runs/$run_id/artifacts \
408+
ARTIFACTS=$(gh api repos/${{ github.repository }}/actions/runs/$run_id/artifacts --paginate \
409409
--jq '.artifacts[] | select(.name | startswith("coverage-history-")) | .archive_download_url' \
410410
2>/dev/null || echo "")
411411
@@ -1078,7 +1078,7 @@ jobs:
10781078
echo "🔍 Checking run $run_id for coverage artifacts..."
10791079
10801080
# Look for coverage-data artifact
1081-
COVERAGE_ARTIFACTS=$(gh api repos/${{ github.repository }}/actions/runs/$run_id/artifacts \
1081+
COVERAGE_ARTIFACTS=$(gh api repos/${{ github.repository }}/actions/runs/$run_id/artifacts --paginate \
10821082
--jq '.artifacts[] | select(.name == "coverage-data") | .archive_download_url' \
10831083
2>/dev/null || echo "")
10841084

0 commit comments

Comments
 (0)