fix: prevent double-value GITHUB_OUTPUT from grep -c with or pipe echo default - #14
Merged
Conversation
…ault Bug: outputs '0' and exits code 1 when no matches found. The fallback then outputs another '0', creating a two-line value (0\n0) that gets written to GITHUB_OUTPUT as: secrets-found=0 0 This is invalid GitHub Actions output format — second lone '0' triggers 'Invalid format' error. Fix: use pattern instead of , so the captured stdout comes only from grep and the fallback sets the variable directly without echoing. Applies to both ISSUES and SECRETS variables in Extract Results.
🔍 AILINTER Code Quality Report
✅ All AILINTER checks passed! View full output in the workflow run. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
PR #44 (ROADMAP.md only) failed CI with:
Root Cause
In the
Extract Resultsstep of.github/actions/ailinter-check:SECRETS=$(grep -cE '...' file 2>/dev/null || echo 0)grep -cwith no matches outputs0to stdout and exits with code 1. The|| echo 0fallback then outputs another0. The captured value becomes0\n0(two lines).Then
echo secrets-found=${SECRETS} >> ${GITHUB_OUTPUT}writes:The second lone
0is not a validkey=valueline →Invalid format '0'.Fix
Changed
|| echo 0to|| VAR=0— the fallback sets the variable directly without extra stdout.Applies to both
ISSUESandSECRETSvariables.Verification
Fixes CI failure on PRs with only non-Go files.