Skip to content

Navigation Menu

Sign in
Sign up

fix(ci): prevent release-drift and auto-release pipeline SIGPIPE/EPIP... - #1173

Open
Adityakk9031 wants to merge 3 commits into
najmuzzaman-mohammad:main from
Adityakk9031:#990
Open

fix(ci): prevent release-drift and auto-release pipeline SIGPIPE/EPIP... #1173
Adityakk9031 wants to merge 3 commits into
najmuzzaman-mohammad:main from
Adityakk9031:#990

Conversation

@Adityakk9031

@Adityakk9031 Adityakk9031 commented Jul 18, 2026
edited by coderabbitai Bot
Loading

Copy link
Copy Markdown

close:#990

Summary

Fixes a recurring failure where the Release drift check (release-drift.yml) and Auto Release (auto-release.yml) workflows fail with grep: write error: Broken pipe (exit code 2 / 141).

Root Cause

Both workflows utilized short-circuiting pipelines to get the latest tag:

  • release-drift.yml: git tag --merged origin/main --sort=-v:refname | grep -E '^v[0-9]' | head -n1
  • auto-release.yml: git tag --sort=-v:refname | grep '^v' | head -1

Under set -o pipefail (explicitly or via GitHub Actions' default shell configuration), head exits immediately after printing the first line and closes its side of the pipe. When the preceding grep tries to write subsequent lines to the closed pipe, it receives a SIGPIPE / EPIPE.

Because GitHub Actions runners often inherit SIG_IGN on SIGPIPE, grep gets an EPIPE on its next write, prints grep: write error: Broken pipe, and exits with code 2. Under pipefail, this non-zero exit code propagates and fails the entire workflow job.

Changes

  1. Removed grep + head: Switched to native git tag filtering using the --list parameter.
  2. Replaced with awk 'NR==1': Used awk 'NR==1' as the stream selector. Unlike head, awk 'NR==1' reads the entire stdin stream to completion (but only prints the first line). This prevents the writer (git tag) from encountering a closed pipe and guarantees a successful 0 exit code.

Summary by CodeRabbit

  • Bug Fixes
    • Improved automated release workflows’ logic for selecting the newest valid version tag.
    • Added stricter semver-like tag matching and deterministic newest-tag sorting to ensure release creation and drift checks consistently use the correct tag.

Adityakk9031 requested review from a team and FranDias as code owners July 18, 2026 05:24

coderabbitai Bot commented Jul 18, 2026
edited
Loading

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

i️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 6b2061ae-5ca4-4d21-bf3d-98dc2d2e7ee8

📥 Commits

Reviewing files that changed from the base of the PR and between 4f1af11 and 81723fc.

📒 Files selected for processing (2)
  • .github/workflows/auto-release.yml
  • .github/workflows/release-drift.yml

📝 Walkthrough

Walkthrough

Both release workflows now select the latest merged version tag using descending Git version sorting, stricter semver-like matching, and awk instead of looser grep and head pipelines.

Changes

Release tag selection

Layer / File(s) Summary
Sorted version tag selection
.github/workflows/auto-release.yml, .github/workflows/release-drift.yml
Both workflows filter descending version-sorted merged tags to semver-like v<major>.<minor>.<patch> tags with optional suffixes, then select the first match with awk.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related issues

  • Issue 990 — Updates the release-drift.yml tag-selection pipeline associated with the reported grep | head failure pattern.

Suggested reviewers: frandias, najmuzzaman-mohammad

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the CI workflow fix for release-drift and auto-release tag selection issues under pipefail.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/auto-release.yml:
- Line 53: Use the same clean semantic-version tag predicate as
desktop-release.yml in the tag-selection commands at
.github/workflows/auto-release.yml:53 and
.github/workflows/release-drift.yml:68. Replace the broad v* and v[0-9]* filters
so both jobs select only valid release tags and resolve an identical tag set.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

i️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: d10e5840-89f5-4159-bbb3-76976370e303

📥 Commits

Reviewing files that changed from the base of the PR and between 2aa53c1 and fb43545.

📒 Files selected for processing (2)
  • .github/workflows/auto-release.yml
  • .github/workflows/release-drift.yml

Comment thread .github/workflows/auto-release.yml Outdated

Copy link
Copy Markdown
Author

@FranDias have a look

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/auto-release.yml:
- Around line 53-54: The TAG assignment pipeline must remain successful when
grep finds no matching tags under pipefail and set -e. Update the filtering
stage in the tag-generation step to consume all input and return success for an
empty result, while preserving the existing semver filter and v0.0.0 fallback.
- Line 53: Update the TAG assignment in the auto-release workflow to restrict
candidate tags to those merged into origin/main before applying the existing
version sort and format filter. Preserve the current highest-version selection
and release tag pattern while excluding tags reachable only from other branches.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

i️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: d2af5a27-681c-486d-8a1c-95ee92d5ad4f

📥 Commits

Reviewing files that changed from the base of the PR and between fb43545 and 4f1af11.

📒 Files selected for processing (2)
  • .github/workflows/auto-release.yml
  • .github/workflows/release-drift.yml

Comment thread .github/workflows/auto-release.yml Outdated
Comment thread .github/workflows/auto-release.yml Outdated

Copy link
Copy Markdown
Author

@FranDias have a look

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@FranDias FranDias Awaiting requested review from FranDias
1 more reviewer
@coderabbitai coderabbitai[bot] coderabbitai[bot] left review comments
Reviewers whose approvals may not affect merge requirements

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

AltStyle によって変換されたページ (->オリジナル) /