fix(scripts): backticks in a double-quoted echo run as command substitution - #492
fix(scripts): backticks in a double-quoted echo run as command substitution#492hyperpolymath wants to merge 7 commits into
Conversation
…tution Line 19 wrapped an example in backticks inside a double-quoted string. Backticks there are COMMAND SUBSTITUTION, so bash tried to execute '+ uses: …@<sha>' and printed the message with the example silently deleted. Switched to single quotes. Same defect class as hyperpolymath/Axiom.jl#82. Found by an estate-wide shellcheck sweep of 5,111 tracked scripts across 375 repos. This file was one of 11 that fail to PARSE (SC1073/SC1072) — shellcheck stops analysing at the failure, so anything after it was never checked either. Verified: shellcheck -S error now reports 0 findings for this file.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📜 Recent review details⏰ Context from checks skipped due to timeout. (3)
|
| Layer / File(s) | Summary |
|---|---|
Skip message quoting scripts/fix-close-obsolete-pr.sh |
The no-pinned-uses: skip message now emits literal backticks. Bash no longer attempts command substitution. |
Estimated code review effort: 1 (Trivial) | ~2 minutes
Merge Risk: ⚪ Minimal · up to 33454
This is a localized shell-script quoting fix with no actionable merge-blocking risk remaining after normal checks and review.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
| Check name | Status | Explanation |
|---|---|---|
| Title check | ✅ Passed | The title clearly identifies the shell-script fix and the command-substitution defect caused by backticks. |
| Description check | ✅ Passed | The description accurately explains the Bash defect, the fix, and the verification result. |
| Docstring Coverage | ✅ Passed | No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1… |
| 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. |
Full details: Docstring Coverage
Explanation
No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1 files.
✨ Finishing Touches
🛠️ Fix failing CI checks
- Create stacked PR
- Commit on current branch
📝 Generate docstrings
- Create stacked PR
- Commit on current branch
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.
A rabbit checks the shell with care
Backticks now remain in place
The message stays clear
No command runs here
One small fix rests there
Comment @coderabbitai help to get the list of available commands.
This comment has been minimized.
This comment has been minimized.
Up to standards ✅🟢 Issues
|
There was a problem hiding this comment.
Pull Request Overview
The PR correctly identifies and addresses a command substitution bug in scripts/fix-close-obsolete-pr.sh where backticks within double quotes were being executed. However, the current solution of switching to single quotes has triggered a new ShellCheck warning, resulting in the PR being flagged as not up to standards by Codacy.
To resolve this and satisfy the linter while maintaining the fix, the backticks should be escaped within double quotes. Additionally, there is a lack of automated or manual verification scenarios provided in the code to ensure the output remains correct after these changes.
Test suggestions
- Execute the script with a PR diff containing no matching lines and verify the output is 'SKIP: PR has no
+ uses: …@<sha>lines' without shell execution errors.
Prompt proposal for missing tests
Consider implementing these tests if applicable:
1. Execute the script with a PR diff containing no matching lines and verify the output is 'SKIP: PR has no `+ uses: …@<sha>` lines' without shell execution errors.
TIP Improve review quality by adding custom instructions
TIP How was this review? Give us feedback
Co-authored-by: codacy-production[bot] <61871480+codacy-production[bot]@users.noreply.github.com> Signed-off-by: Jonathan D.A. Jewell <6759885+hyperpolymath@users.noreply.github.com>
|
| GitGuardian id | GitGuardian status | Secret | Commit | Filename | |
|---|---|---|---|---|---|
| 36740420 | Triggered | Generic Password | b84e2f0 | bots/cipherbot/src/analyzers/infra.rs | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secret safely. Learn here the best practices.
- Revoke and rotate this secret.
- If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
|
✅ Coding Agent task started: View task and status The task will inspect the CI failures, validate its fix, and open a stacked fix pull request automatically.
⏭️ 6 check(s) skipped — already failing on `main` (not caused by this PR)
|
Line 19 wrapped an example in backticks inside a double-quoted string. Backticks there are COMMAND SUBSTITUTION, so bash tried to execute '+ uses: …@' and printed the message with the example silently deleted. Switched to single quotes. Same defect class as hyperpolymath/Axiom.jl#82.
Found by an estate-wide shellcheck sweep of 5,111 tracked scripts across 375 repos. This file was one of 11 that fail to parse (
SC1073/SC1072) — shellcheck stops analysing at the failure, so everything after it was never checked either.Verified:
shellcheck -S errornow reports 0 findings for this file.