Conversation
There was a problem hiding this comment.
Pull request overview
This PR syncs GitHub workflow/action updates to ensure artifact discovery is complete by paginating gh api calls when listing workflow run artifacts, preventing missed artifacts when runs produce more than the default page size.
Changes:
- Added
--paginatetogh apiartifact-listing calls in the resilient artifact download composite action. - Added
--paginatetogh apiartifact-listing calls in thefortress-coverageworkflow for coverage-history and coverage-data discovery.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| .github/workflows/fortress-coverage.yml | Paginates artifact listing so coverage-history and coverage-data artifacts are discoverable beyond the first page. |
| .github/actions/download-artifact-resilient/action.yml | Paginates artifact listing in the composite action to avoid incomplete artifact preflight results. |
Comments suppressed due to low confidence (1)
.github/actions/download-artifact-resilient/action.yml:111
gh api .../artifacts --paginatereturns one JSON object per page (newline-delimited). Capturing that intoARTIFACTS_JSONmakes it a multi-document stream, but later code treats it as a single JSON document (e.g., thejq ... | lengthused forAVAILABLE_ARTIFACTS). With pagination, this produces multiple lengths (one per page), which can introduce newlines intoARTIFACTS_FOUNDand ultimately write an invalidartifacts-found=line to$GITHUB_OUTPUT. Consider aggregating paginated pages before further processing (e.g.,jq -sto merge.artifactsarrays / sum lengths) or avoid storing page objects by usinggh api --paginate --jq '.artifacts[]'and deriving counts from that stream.
ARTIFACTS_JSON=$(gh api repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts --paginate 2>&1) || {
API_ERROR=$?
echo "⚠️ Failed to fetch artifacts list (exit code: $API_ERROR)"
echo " Response: $ARTIFACTS_JSON"
echo "↪ Falling back to direct download attempt (skipping preflight list)"
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Changed
--paginateflag togh apicalls when fetching artifacts lists in.github/actions/download-artifact-resilient/action.yml--paginateflag togh apicalls when fetching coverage history artifacts in.github/workflows/fortress-coverage.yml(line 408)--paginateflag togh apicalls when fetching coverage-data artifacts in.github/workflows/fortress-coverage.yml(line 1081)Why It Was Necessary
Testing Performed
Impact / Risk
--paginateflag is additive and doesn't change existing behavior for small result sets