There was an error while loading. Please reload this page.
2 parents 4a396bf + 91e1738 commit 5b2358eCopy full SHA for 5b2358e
1 file changed
.github/workflows/cli-test.yml
@@ -89,11 +89,18 @@ jobs:
89
id: choose-ref
90
shell: bash
91
run: |
92
- if [[ "${{ matrix.version }}" == "nightly" ]]
+ if [[ "$CLI_VERSION" == "nightly" ]]
93
then
94
REF="codeql-cli/latest"
95
else
96
- REF="codeql-cli/${{ matrix.version }}"
+ # Validate the version read from supported_cli_versions.json before
97
+ # using it, to guard against script injection from untrusted input.
98
+ if [[ ! "$CLI_VERSION" =~ ^v?[0-9]+\.[0-9]+\.[0-9]+$ ]]
99
+ then
100
+ echo "Unexpected CLI version: '$CLI_VERSION'" >&2
101
+ exit 1
102
+ fi
103
+ REF="codeql-cli/$CLI_VERSION"
104
fi
105
echo "ref=$REF" >> "$GITHUB_OUTPUT"
106
0 commit comments