ci: update release fetching logic in workflow#3918
ci: update release fetching logic in workflow#3918officialasishkumar wants to merge 2 commits intov2from
Conversation
* Changed the method to fetch the latest release tag from GitHub API to ensure it retrieves the most recent version. * Enhanced the curl command to include retry logic for improved reliability during download.
There was a problem hiding this comment.
Pull request overview
Updates the prepare_and_run GitHub Actions workflow’s logic for downloading the latest Keploy release artifact during CI runs on the v2 branch.
Changes:
- Switch release tag discovery to GitHub’s
/releases/latestendpoint. - Add curl retry flags when downloading the release tarball.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - name: Upload latest release | ||
| run: | | ||
| TAG=$(curl -s https://api.github.com/repos/keploy/keploy/releases | jq -r '[.[] | select(.tag_name | startswith("v2"))][0].tag_name') | ||
| TAG=$(curl -fsSL "https://api.github.com/repos/keploy/keploy/releases/latest" | jq -r '.tag_name') |
There was a problem hiding this comment.
The workflow is triggered only on the v2 branch and previously explicitly selected a tag_name starting with v2. Switching to the /releases/latest endpoint removes that constraint and can fetch a non-v2 release (e.g., v3) if it becomes the latest, causing the workflow to download an incompatible artifact. Consider keeping the v2 filter (with pagination if needed) or at least validate TAG starts with v2 and fail with a clear error if it doesn’t.
| TAG=$(curl -fsSL "https://api.github.com/repos/keploy/keploy/releases/latest" | jq -r '.tag_name') | |
| TAG=$(curl -fsSL "https://api.github.com/repos/keploy/keploy/releases/latest" | jq -r '.tag_name') | |
| if [[ "$TAG" != v2* ]]; then | |
| echo "ERROR: Latest release tag '$TAG' is not a v2.* tag; refusing to download incompatible artifact." >&2 | |
| exit 1 | |
| fi |
* Changed the branch reference from 'v2' to 'sync-v2-with-v3' for fetching the latest commit hash in the setup-private-parsers action. * Minor formatting adjustment in the echo command for creating extraparsers.go.
Describe the changes that are made
Links & References
Closes: #[issue number that will be closed through this PR]
🔗 Related PRs
🐞 Related Issues
📄 Related Documents
What type of PR is this? (check all applicable)
Added e2e test pipeline?
Added comments for hard-to-understand areas?
Added to documentation?
Are there any sample code or steps to test the changes?
Self Review done?
Any relevant screenshots, recordings or logs?
🧠 Semantics for PR Title & Branch Name
Please ensure your PR title and branch name follow the Keploy semantics:
📌 PR Semantics Guide
📌 Branch Semantics Guide
Examples:
fix: patch MongoDB document update bugfeat/#1-login-flow(You may skip mentioning the issue number in the branch name if the change is small and the PR description clearly explains it.)Additional checklist: