Skip to content

Commit 3fb0139

Browse files
committed
Protect against flag injection
1 parent 5e2cab4 commit 3fb0139

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

.github/workflows/qhelp-pr-preview.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,17 @@ jobs:
2929
run: |
3030
(git diff --name-only --diff-filter=ACMRT HEAD~1 HEAD | grep '.qhelp$' | grep -v '.inc.qhelp';
3131
git diff --name-only --diff-filter=ACMRT HEAD~1 HEAD | grep '.inc.qhelp$' | xargs -d '\n' -rn1 basename | xargs -d '\n' -rn1 git grep -l) |
32-
grep '.qhelp$' | sort -u > "${{ runner.temp }}/paths.txt"
32+
grep '.qhelp$' | grep -v '^-' | sort -u > "${{ runner.temp }}/paths.txt"
3333
3434
- name: QHelp preview
3535
run: |
3636
cat "${{ runner.temp }}/paths.txt" | while read path; do
37+
if [ ! -f "${path}" ]; then
38+
exit 1
39+
fi
3740
echo "<details> <summary>${path}</summary>"
3841
echo
39-
codeql generate query-help --format=markdown "${path}"
42+
codeql generate query-help --format=markdown -- "./${path}"
4043
echo "</details>"
4144
done > comment.txt
4245

0 commit comments

Comments
 (0)