Skip to content

fix: correct awk range to stop redis-exporter version loop#46

Merged
1 commit merged intomainfrom
claude/fix-version-loop-Viw0O
Mar 3, 2026
Merged

fix: correct awk range to stop redis-exporter version loop#46
1 commit merged intomainfrom
claude/fix-version-loop-Viw0O

Conversation

@ghost
Copy link
Copy Markdown

@ghost ghost commented Mar 3, 2026

The awk range pattern /^metrics:/,/^[a-z]+:/ was broken because "metrics:" matches BOTH the start and end patterns simultaneously. In awk, when both patterns match the same line, the range opens and closes immediately — so the body never runs and CURRENT is always empty. Since any real version != "", the workflow always detected a "new update" for redis-exporter, creating the same PR on every run.

Two bugs fixed:

  • Replace the broken range with a flag-based approach (found=1; next) that skips the "metrics:" line before checking the exit condition.
  • Replace /^\s+tag:/ with /^ +tag:/ since \s is not POSIX awk.

https://claude.ai/code/session_01MDiuwf2FT7zd7aqGhTBuCL

The awk range pattern /^metrics:/,/^[a-z]+:/ was broken because
"metrics:" matches BOTH the start and end patterns simultaneously.
In awk, when both patterns match the same line, the range opens and
closes immediately — so the body never runs and CURRENT is always
empty. Since any real version != "", the workflow always detected a
"new update" for redis-exporter, creating the same PR on every run.

Two bugs fixed:
- Replace the broken range with a flag-based approach (found=1; next)
  that skips the "metrics:" line before checking the exit condition.
- Replace /^\s+tag:/ with /^ +tag:/ since \s is not POSIX awk.

https://claude.ai/code/session_01MDiuwf2FT7zd7aqGhTBuCL
@ghost ghost merged commit b545e50 into main Mar 3, 2026
8 checks passed
@ghost ghost deleted the claude/fix-version-loop-Viw0O branch March 3, 2026 20:31
This pull request was closed.
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