Skip to content

Commit ce7bbb3

Browse files
authored
GitHub action: shell escaping (#342)
This PR updates one of our workflows: the embedded shell commands weren't surrounding variable expansion with quotes, which could lead to incorrect commands being executed.
1 parent 287fcd2 commit ce7bbb3

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

.github/workflows/no-cheat.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ jobs:
2020

2121
- name: Verify no lint is disabled in the new code
2222
run: |
23-
git fetch origin $GITHUB_BASE_REF:$GITHUB_BASE_REF
24-
git diff $GITHUB_BASE_REF...$(git branch --show-current) >> diff_data.txt
23+
git fetch origin "${GITHUB_BASE_REF}:${GITHUB_BASE_REF}"
24+
git diff "${GITHUB_BASE_REF}...$(git branch --show-current)" >> diff_data.txt
2525
python tests/unit/no_cheat.py diff_data.txt >> cheats.txt
26-
COUNT=$(cat cheats.txt | wc -c)
26+
COUNT="$(cat cheats.txt | wc -c)"
2727
if [ ${COUNT} -gt 1 ]; then
2828
cat cheats.txt
2929
exit 1

0 commit comments

Comments
 (0)