Skip to content

fix(script): silence git rm --cached stdout to prevent JSON corruption#735

Merged
hilram7 merged 1 commit intodevfrom
fix/md-autofix-silence-git-rm
Apr 9, 2026
Merged

fix(script): silence git rm --cached stdout to prevent JSON corruption#735
hilram7 merged 1 commit intodevfrom
fix/md-autofix-silence-git-rm

Conversation

@hilram7
Copy link
Copy Markdown
Collaborator

@hilram7 hilram7 commented Apr 9, 2026

Root cause

When the workflow checks out the PR head branch, the files without .md are tracked in the git index. git rm --cached succeeds and prints rm 'filename' to stdout, which gets captured in the SUMMARY variable and corrupts the JSON, causing jq to fail with exit code 5.

Previously undetected because the workflow checked out the base branch (dev), where the PR files aren't tracked — git rm --cached failed silently with no stdout output.

Fix

Add -q to silence git rm --cached stdout.

Testing

Tested locally by simulating the workflow condition: checked out the PR head branch (files tracked in git index), ran the script, confirmed clean JSON output and correctly renames/injects frontmatter.

@hilram7 hilram7 marked this pull request as ready for review April 9, 2026 22:30
@hilram7 hilram7 merged commit db351b4 into dev Apr 9, 2026
5 checks passed
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