Skip to content

fix(ci): store regex in variables to fix notify-parent parse error - #18

Merged
mateodelnorte merged 1 commit into
mainfrom
fix/notify-parent-regex
Feb 19, 2026
Merged

mateodelnorte merged 1 commit into
mainfrom
fix/notify-parent-regex

Conversation

@mateodelnorte

@mateodelnorte mateodelnorte commented Feb 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Stores regex patterns in bash variables before using them in [[ =~ ]] tests
  • Fixes bash parse error: ( in [:(] character class was interpreted as unmatched subshell opener
  • Error: unexpected EOF while looking for matching ')' (exit code 2)
  • Broken since cascading notification support was added

Root cause

# Broken — bash parses ( as subshell opener before regex engine sees it
if [[ "$MSG" =~ ^feat[:(] ]]; then ...

# Fixed — variable content passes directly to regex engine
re_feat='^feat[:(]'
if [[ "$MSG" =~ $re_feat ]]; then ...

Context

  • Part of [[tasks/meta-64]] / [[incidents/notify-parent-broken]]
  • Same fix applied to all 5 affected child repos

Test plan

  • Workflow passes on next push to main after merge

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Improved CI workflow event detection and exposed key event metadata to downstream steps.
    • Unified how workflow outputs are produced and written, ensuring consistent output delivery across trigger types.
    • Streamlined commit-type detection using consolidated pattern matching for more reliable classification.

Note: No user-facing changes in this release.

@coderabbitai

coderabbitai Bot commented Feb 18, 2026 •

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉


Walkthrough

Reworks .github/workflows/notify-parent.yml to expose event/payload via environment variables, add a reusable write_output helper that writes to $GITHUB_OUTPUT, normalize outputs for repository_dispatch and other events, switch event branching to compare EVENT_NAME, and replace inline type-detection with predeclared regex variables.

Changes

Cohort / File(s) Summary
Notify workflow
.github/workflows/notify-parent.yml
Adds environment variables exposing event and payload, introduces write_output helper to append key/value pairs to $GITHUB_OUTPUT, emits outputs for repository_dispatch and non-dispatch flows via that helper, replaces direct event checks with EVENT_NAME and replaces inline type-detection with named regex variables (re_feat, re_fix, re_chore, re_docs, re_test, re_refactor) mapping matches to type (defaults to other).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

🐇
I nudged the envs and fetched the payload light,
I stitched outputs tidy in the GitHub night.
Regex paws tapped, labels found their home,
write_output thumps — a neat little poem. ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly addresses the main change: storing regex patterns in variables to fix a bash parse error in the notify-parent workflow.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/notify-parent-regex

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

@greptile-apps

greptile-apps Bot commented Feb 18, 2026

Copy link
Copy Markdown

Greptile Summary

Fixes a bash parse error in the notify-parent workflow by storing regex patterns in variables before using them in [[ =~ ]] tests.

  • The character class [:(] was causing bash to interpret ( as an unmatched subshell opener before the regex engine could process it
  • Storing patterns in variables (e.g., re_feat='^feat[:(]') prevents premature parsing and passes the pattern directly to the regex engine
  • All 6 commit type patterns (feat, fix, chore, docs, test, refactor) have been updated consistently
  • This restores cascading notification functionality that was broken since the feature was added

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The fix is straightforward and well-understood: storing regex patterns in variables is a standard bash best practice for avoiding parse errors. The regex patterns remain functionally identical, and testing confirms they match both colon and parenthesis variants correctly. No logic changes, only syntax improvements.
  • No files require special attention

Important Files Changed

Filename Overview
.github/workflows/notify-parent.yml Stores regex patterns in bash variables to prevent parse error in [[ =~ ]] tests, fixing cascading notification workflow

Last reviewed commit: e87511d

@mateodelnorte
mateodelnorte force-pushed the fix/notify-parent-regex branch 2 times, most recently from b4d021f to c6fe853 Compare February 19, 2026 00:27
Bash interprets `(` in `[:(]` character classes as an unmatched
subshell opener, causing "unexpected EOF while looking for matching ')'"
(exit code 2). Storing the regex in a variable avoids this because bash
passes variable content directly to the regex engine without shell parsing.

Resolves [[incidents/notify-parent-broken]]
Implements [[tasks/meta-64]]

Co-authored-by: Claude <claude@anthropic.com>
@mateodelnorte
mateodelnorte force-pushed the fix/notify-parent-regex branch from c6fe853 to bb2fbc6 Compare February 19, 2026 03:23
@mateodelnorte
mateodelnorte merged commit 8d4a585 into main Feb 19, 2026
7 checks passed
@mateodelnorte
mateodelnorte deleted the fix/notify-parent-regex branch February 19, 2026 04:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant