Skip to content

Commit 389c832

Browse files
committed
CI: Update CodeQL Action test to use setup-codeql
1 parent ca42bf2 commit 389c832

File tree

1 file changed

+12
-19
lines changed

1 file changed

+12
-19
lines changed

.github/workflows/codeql.yml

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -34,39 +34,32 @@ jobs:
3434

3535
steps:
3636
- uses: actions/checkout@v6
37-
- name: Init with default CodeQL bundle from the VM image
38-
id: init-default
39-
uses: ./init
40-
with:
41-
languages: javascript
42-
- name: Remove empty database
43-
# allows us to run init a second time
44-
run: |
45-
rm -rf "$RUNNER_TEMP/codeql_databases"
46-
- name: Init with latest CodeQL bundle
47-
id: init-latest
48-
uses: ./init
37+
- name: Set up default CodeQL bundle
38+
id: setup-default
39+
uses: ./setup-codeql
40+
- name: Set up linked CodeQL bundle
41+
id: setup-linked
42+
uses: ./setup-codeql
4943
with:
5044
tools: linked
51-
languages: javascript
52-
- name: Compare default and latest CodeQL bundle versions
45+
- name: Compare default and linked CodeQL bundle versions
5346
id: compare
5447
env:
55-
CODEQL_DEFAULT: ${{ steps.init-default.outputs.codeql-path }}
56-
CODEQL_LATEST: ${{ steps.init-latest.outputs.codeql-path }}
48+
CODEQL_DEFAULT: ${{ steps.setup-default.outputs.codeql-path }}
49+
CODEQL_LINKED: ${{ steps.setup-linked.outputs.codeql-path }}
5750
run: |
5851
CODEQL_VERSION_DEFAULT="$("$CODEQL_DEFAULT" version --format terse)"
59-
CODEQL_VERSION_LATEST="$("$CODEQL_LATEST" version --format terse)"
52+
CODEQL_VERSION_LINKED="$("$CODEQL_LINKED" version --format terse)"
6053
echo "Default CodeQL bundle version is $CODEQL_VERSION_DEFAULT"
61-
echo "Latest CodeQL bundle version is $CODEQL_VERSION_LATEST"
54+
echo "Linked CodeQL bundle version is $CODEQL_VERSION_LINKED"
6255
6356
# If we're running on a pull request, run with both bundles, even if `tools: linked` would
6457
# be the same as `tools: null`. This allows us to make the job for each of the bundles a
6558
# required status check.
6659
#
6760
# If we're running on push or schedule, then we can skip running with `tools: linked` when it would be
6861
# the same as running with `tools: null`.
69-
if [[ "$GITHUB_EVENT_NAME" != "pull_request" && "$GITHUB_EVENT_NAME" != "merge_group" && "$CODEQL_VERSION_DEFAULT" == "$CODEQL_VERSION_LATEST" ]]; then
62+
if [[ "$GITHUB_EVENT_NAME" != "pull_request" && "$GITHUB_EVENT_NAME" != "merge_group" && "$CODEQL_VERSION_DEFAULT" == "$CODEQL_VERSION_LINKED" ]]; then
7063
VERSIONS_JSON='[null]'
7164
else
7265
VERSIONS_JSON='[null, "linked"]'

0 commit comments

Comments
 (0)