Skip to content

Commit

Permalink
Quote arguments to check.sh
Browse files Browse the repository at this point in the history
Without this quoting, arguments would get expanded before being passed
to bash, which would cause the following configuration to fail:

    clang-format-version: 12
    check-path: '.'
    exclude-regex: '(foo|bar)'

because `check.sh` would get run as:

    check.sh 12 . LLVM (foo|bar)

And since '(' and '|' are special characters for bash, the action will
immediately fail because of a syntax error.

Instead, it should get ran as:

    check.sh "12" "." "LLVM" "(foo|bar)"
  • Loading branch information
jasonwhite authored and jidicula committed Feb 17, 2022
1 parent 84b86da commit 8ce374a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@ inputs:
runs:
using: "composite"
steps:
- run: ${{ github.action_path }}/check.sh ${{ inputs.clang-format-version }} ${{ inputs.check-path }} ${{ inputs.fallback-style }} ${{ inputs.exclude-regex }}
- run: >
"${{ github.action_path }}/check.sh" "${{ inputs.clang-format-version }}" "${{ inputs.check-path }}" "${{ inputs.fallback-style }}" "${{ inputs.exclude-regex }}"
shell: bash

0 comments on commit 8ce374a

Please sign in to comment.