fix(scripts): backticks in a double-quoted echo run as command substitution - #492
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: Advanced 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. (7)
|
| 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. |
Installation token fixture bots/seambot/tests/github_integration.rs |
The test fixture now uses ghs_test-token and retains the existing prefix and parsing assertions. |
Priority: ⬇️ Low
Estimated code review effort: 1 (Trivial) | ~5 minutes
Change: Bug fix
Merge Risk: ⚪ Minimal · up to c3314
The changes preserve the literal shell message and update only a test token fixture, with no remaining merge-blocking risk.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
| Check name | Status | Explanation |
|---|---|---|
| Title check | ✅ Passed | The title clearly identifies the shell-script fix for unintended command substitution caused by backticks in a double-quoted echo. |
| Description check | ✅ Passed | The description directly explains the command-substitution defect, the fix, and the ShellCheck validation. |
| Docstring Coverage | ✅ Passed | Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. |
| 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. |
✨ Finishing Touches 💡 1
⚔️ Resolve merge conflicts 💡
- Resolve merge conflict in branch
fix/shellcheck-parse-error
🛠️ 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 sees backticks stay still
The shell prints each mark by will
A test token takes a shorter trail
Its ghs_ prefix does not fail
Small changes pass the checking gate
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.
|
ℹ️ Nothing to fix from this PR. All 4 failing check(s) are already failing on ⏭️ 4 check(s) skipped — already failing on `main` (not caused by this PR)
These need to be addressed on |
Replace the credential-shaped GitHub installation token fixture with `ghs_test-token` so CI security and governance checks do not mistake test data for a secret. Validation: `git diff --check` passed; tests were not run. [View coding task](https://app.coderabbit.ai/code/tasks/3ed9558f-b037-4b12-a554-f284f8c8da8e?source=coding_agent_github_pr_description) Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
|
🤖 Completed: Resolve merge conflicts in PR #492 — View commit |
Resolved conflicts in: - bots/seambot/tests/github_integration.rs (unmerged) Co-authored-by: CodeRabbit <noreply@coderabbit.ai> CodeRabbit-Task-Id: f69c464e-26a4-4aef-a799-57b026bdce44
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.