-
Notifications
You must be signed in to change notification settings - Fork 44
Fix paginated return of packages in collect-source.yml workflow #1477
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes the pagination handling in the collect-source.yml workflow to ensure all packages are retrieved when querying the GitHub API. The changes address a bug where only the first page of results was being processed.
Key Changes:
- Added
--paginateflag to GitHub API calls to retrieve all pages of results - Changed
grep -wtogrep -xfor exact tag matching
π‘ Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| VERSION=$(gh api --paginate -H "Accept: application/vnd.github.v3+json" \ | ||
| /orgs/open-edge-platform/packages/container/$TMP_NAME/versions \ | ||
| --jq '.[].metadata.container.tags[]' 2>/dev/null | grep -w "$TAG" || true) | ||
| --jq '.[].metadata.container.tags[]' 2>/dev/null | grep -x "$TAG" || true) |
Copilot
AI
Nov 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The --paginate flag combined with --jq may cause issues because pagination returns multiple JSON arrays, but jq processes each page separately. This could result in the grep command receiving partial data or failing to match tags that span across pages. Consider using --jq '.[] | .metadata.container.tags[] | select(. == \"'$TAG'\")' to handle the filtering within jq itself, which will work correctly with pagination.
| --jq '.[].metadata.container.tags[]' 2>/dev/null | grep -x "$TAG" || true) | |
| --jq '.[] | .metadata.container.tags[] | select(. == "'"$TAG"'")' 2>/dev/null) |
AlexanderBarabanov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, Ivan!
π Description
Fixing processing of paginated return of packages in collect-source.yml workflow
β¨ Type of Change
Select the type of change your PR introduces:
π§ͺ Testing Scenarios
Describe how the changes were tested and how reviewers can test them too:
β Checklist
Before submitting the PR, ensure the following: