Skip to content

Quote shell variables in setup action extraction path handling - #19

Merged
imjasonh merged 2 commits into
mainfrom
copilot/quote-variables-in-conditions
Jun 26, 2026
Merged

Quote shell variables in setup action extraction path handling#19
imjasonh merged 2 commits into
mainfrom
copilot/quote-variables-in-conditions

Conversation

Copilot AI commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

The composite action used unquoted shell variables in conditionals and file/path operations, which can trigger word splitting and pathname expansion in Bash. This updates the action to consistently quote those values in the install path for released binaries.

  • What changed

    • Quote os in the macOS conditional.
    • Quote url in the release-install conditional.
    • Quote archive member and output path arguments during extraction and chmod.
  • Related hardening

    • Quote the temporary directory in cd.
    • Quote PATH assignment and the GITHUB_PATH redirection target in the same block for consistent path handling.
  • Example

    if [[ "$os" == "macOS" ]]; then
      os="Darwin"
    fi
    
    if [[ ! -z "${url}" ]]; then
      tar xzf "$fname" "${out}"
      chmod +x "${tmp}/${out}"
      echo "${tmp}" >> "$GITHUB_PATH"
    fi

@imjasonh

Copy link
Copy Markdown
Owner

@imjasonh
imjasonh marked this pull request as ready for review June 26, 2026 22:33
@imjasonh
imjasonh enabled auto-merge June 26, 2026 22:34
@imjasonh
imjasonh self-requested a review June 26, 2026 22:34
@imjasonh
imjasonh disabled auto-merge June 26, 2026 22:36
@imjasonh
imjasonh merged commit feee3b6 into main Jun 26, 2026
3 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.

2 participants