Fix SC2086 shellcheck warnings in compiler-generated shell scripts#3098
Merged
Fix SC2086 shellcheck warnings in compiler-generated shell scripts#3098
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix SC2086 shellcheck warnings in high-priority workflows
Fix SC2086 shellcheck warnings in compiler-generated shell scripts
Nov 4, 2025
pelikhan
approved these changes
Nov 4, 2025
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds proper quoting around variables and file paths in shell scripts and GitHub Actions workflow files to prevent potential issues with word splitting and special characters.
- Adds quotes around Git command variables in shell scripts (branch names, refs)
- Adds quotes around file paths in
findandechocommands - Adds quotes around
$GITHUB_ENVenvironment variable references
Reviewed Changes
Copilot reviewed 62 out of 62 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/workflow/sh/generate_git_patch.sh | Added quotes to Git branch/ref variables and commands |
| pkg/workflow/safe_output_helpers_test.go | Updated test expectations to match quoted paths |
| pkg/workflow/safe_jobs.go | Added quotes to file paths and $GITHUB_ENV in generated steps |
| pkg/workflow/artifacts.go | Added quotes to file paths and $GITHUB_ENV in artifact download steps |
| Multiple .github/workflows/*.lock.yml files | Regenerated workflow lockfiles with quoted paths and variables |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Shellcheck reported SC2086 warnings (unquoted variables causing potential word splitting/globbing) in compiler-generated
.lock.ymlfiles across all workflows.Changes
Compiler code generation:
pkg/workflow/artifacts.go- Quote path variables infindcommands and$GITHUB_ENVredirectspkg/workflow/safe_jobs.go- Quote path variables infindcommands and$GITHUB_ENVredirectspkg/workflow/sh/generate_git_patch.sh- Quote git ref variables ($BRANCH_NAME,$DEFAULT_BRANCH)Before:
After:
Test updates:
pkg/workflow/safe_output_helpers_test.go- Update expected strings to match quoted formatAll 68 workflows recompiled with fixes applied.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.