Skip to content

Commit ee7a087

Browse files
committed
feat(ci): Simplify CodeQL CLI version handling in action.yml
1 parent 6804a32 commit ee7a087

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

.github/actions/install-codeql/action.yml

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ name: Setup CodeQL CLI
22
description: |
33
Install a CodeQL CLI or re-use an existing one from the cache and it to the path.
44
inputs:
5-
codeql-cli-version:
6-
description: |
7-
The version of the CodeQL CLI to be downloaded.
5+
86
outputs:
97
codeql-cli-version:
108
description: "The version of the CodeQL CLI that was installed or retrieved from cache"
@@ -29,17 +27,11 @@ runs:
2927
env:
3028
GITHUB_TOKEN: ${{ github.token }}
3129
CODEQL_HOME: ${{ github.workspace }}/codeql_home
32-
CODEQL_CLI_VERSION: ${{ inputs.codeql-cli-version }}
3330
run: |
34-
if [ -z "$CODEQL_CLI_VERSION" ]; then
35-
echo "No CodeQL CLI version specified. Checking for .codeqlversion file."
36-
if [ ! -f ./.codeqlversion ]; then
37-
echo "Error: .codeqlversion file not found. Please specify a CodeQL CLI version." >&2
38-
exit 1
39-
fi
40-
echo "Reading CodeQL CLI version from .codeqlversion file."
41-
CODEQL_CLI_VERSION=$(cat ./.codeqlversion)
42-
fi
31+
set -e
32+
33+
echo "Reading CodeQL CLI version from .codeqlversion file."
34+
CODEQL_CLI_VERSION=$(cat ./.codeqlversion)
4335
echo "Installing CodeQL CLI v${CODEQL_CLI_VERSION}."
4436
4537
mkdir -p $CODEQL_HOME

0 commit comments

Comments
 (0)