fix: guard git tag pipelines against SIGPIPE in gptchangelog (closes #388)#390
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (4)
WalkthroughFour workflow/composite-action files now append ChangesSIGPIPE Tolerance for Tag Queries
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
Pull requests to main can only come from:
Your source branch: Please change the base branch or create a PR from an allowed branch. |
🔍 PR Validation Summary✅ PR Mergeable — no blocking failures
|
🔍 Lint Analysis
|
🛡️ CodeQL Analysis ResultsLanguages analyzed: ✅ No security issues found. 🔍 View full scan logs | 🛡️ Security tab |
GitHub Actions Shared Workflows
Description
Under the GitHub Actions default shell (
bash --noprofile --norc -eo pipefail), a pipeline likegit tag --sort=... | head -Nfails with exit 141 (SIGPIPE) on repos with many tags:headcloses the pipe after N lines,git tagreceivesSIGPIPE, andpipefailpropagates141, whichset -eturns into a step failure. This broke theGenerate Changelogjob on every stable release in tag-heavy repos (observed onplugin-br-pix-indirect-btg, run linked below).This PR appends
|| trueto every unguardedgit tag … | head …pipeline — the same pattern already used insrc/config/release-tag-snapshot/action.yml:17andsrc/config/changed-paths/action.yml:94,96. As a bonus it also fixes a latentset -eabort on the grep-filtered pipelines (grepreturns1when no tag matches); downstream code already handles an empty result via[ -z "$TAG" ]guards, so behavior is preserved.Affected workflow(s)/actions:
src/changelog/gptchangelog/action.yml(lines 82, 167, 237) — the action consumed byrelease.ymlvia@v1.github/workflows/gptchangelog.yml(lines 83, 196, 332)src/config/release-tag-check/action.yml(line 27) — used byrelease.yml's release-detection path.github/workflows/helm-release-notification.yml(line 104)Repo-wide sweep result:
.github/workflows/dispatch-helm.yml:122uses… | tail -1.tailreads the entire stream and never closes the pipe early, so it is not SIGPIPE-vulnerable and was intentionally left unchanged. No other unguardedgit tag … | head/tailpipelines remain.Type of Change
fix: Bug fix in a workflow (incorrect behavior, broken step, wrong condition)Breaking Changes
None.
Testing
yaml.safe_loadon all 4 files)@this-branchor the beta tag|| trueappended)Caller repo / workflow run: failing run that motivated the fix — https://github.com/LerianStudio/plugin-br-pix-indirect-btg/actions/runs/26657889439/job/78572886408
Consumers that benefit
Any repo consuming
release.ymlwithenable_changelog: true(and thegptchangelog/helm-release-notificationworkflows) on a repository with a large tag history — in particular every repo running a maintenance/patch line, which accumulates tags fastest. Thegptchangelogaction is pinned by consumers as@v1; on merge tomaintheupdate_major_tagjob (enabled byself-release.yml) moves the floatingv1tag, so consumers pick up the fix automatically.Related Issues
Closes #388
Summary by CodeRabbit