Skip to content

Commit c67cef0

Browse files
committed
feat(ci): Enhance CodeQL action to output installed CLI version
1 parent 971e8f8 commit c67cef0

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ inputs:
55
codeql-cli-version:
66
description: |
77
The version of the CodeQL CLI to be downloaded.
8+
outputs:
9+
codeql-cli-version:
10+
description: "The version of the CodeQL CLI that was installed or retrieved from cache"
11+
value: ${{ steps.install-codeql.outputs.codeql-cli-version }}
812

913
runs:
1014
using: composite
@@ -19,6 +23,7 @@ runs:
1923
key: codeql-home-${{ inputs.codeql-cli-version }}
2024

2125
- name: Install CodeQL
26+
id: install-codeql
2227
if: steps.cache-codeql.outputs.cache-hit != 'true'
2328
shell: bash
2429
env:
@@ -44,6 +49,7 @@ runs:
4449
4550
popd
4651
echo "Done."
52+
echo "codeql-cli-version=${CODEQL_CLI_VERSION}" >> $GITHUB_OUTPUT
4753
4854
- name: Add CodeQL to the PATH
4955
shell: bash

.github/workflows/ci.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,14 @@ jobs:
3131
3232
- name: Setup CodeQL
3333
if: steps.changes.outputs.src == 'true'
34+
id: install-codeql
3435
uses: ./.github/actions/install-codeql
35-
with:
36-
codeql-cli-version: ${{ env.CODEQL_CLI_VERSION }}
3736

3837
- name: Install Packs
3938
if: steps.changes.outputs.src == 'true'
4039
env:
4140
GITHUB_TOKEN: ${{ github.token }}
42-
CODEQL_CLI_VERSION: ${{ env.CODEQL_CLI_VERSION }}
41+
CODEQL_CLI_VERSION: ${{ steps.install-codeql.outputs.codeql-cli-version }}
4342
run: |
4443
gh repo clone github/codeql -- -b codeql-cli-${CODEQL_CLI_VERSION} # to make stubs available for tests
4544
codeql pack install "${{ matrix.language }}/lib"
@@ -247,5 +246,3 @@ jobs:
247246
GITHUB_TOKEN: ${{ github.token }}
248247
run: |
249248
./.github/scripts/pr-configs.sh "${{ github.event.number }}"
250-
251-

.github/workflows/publish.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ on:
55
branches: [main]
66
workflow_dispatch:
77

8-
env:
9-
CODEQL_CLI_VERSION: 2.20.1
108

119
jobs:
1210
queries:
@@ -42,8 +40,6 @@ jobs:
4240
- name: Setup CodeQL
4341
if: steps.check_version.outputs.publish == 'true'
4442
uses: ./.github/actions/install-codeql
45-
with:
46-
codeql-cli-version: ${{ env.CODEQL_CLI_VERSION }}
4743

4844
- name: Publish codeql-LANG-queries (src) pack.
4945
if: steps.check_version.outputs.publish == 'true'

0 commit comments

Comments
 (0)