Skip to content

Commit 0078753

Browse files
committed
Replace jq with Python script
This simplifies the workflow by only requiring a CodeQL CLI version. The Python script automatically determines a compatible standard library commit and bundle tag. This sacrifices flexibility for correctness, since we can no longer independently specify the the other values.
1 parent d99a94c commit 0078753

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

.github/workflows/upgrade_codeql_dependencies.yml

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@ on:
77
description: |
88
The version of the CodeQL CLI to be set as the default.
99
required: true
10-
codeql_standard_library_commit:
11-
description: |
12-
The tag or commit to use from the CodeQL Standard Library
13-
required: true
1410

1511
env:
1612
XARGS_MAX_PROCS: 4
@@ -19,20 +15,25 @@ jobs:
1915
say_hello:
2016
env:
2117
CODEQL_CLI_VERSION: ${{ github.event.inputs.codeql_cli_version }}
22-
CODEQL_LIB_COMMIT: ${{ github.event.inputs.codeql_standard_library_commit }}
2318
runs-on: ubuntu-22.04
2419
steps:
2520
- name: Checkout
2621
uses: actions/checkout@v2
2722

23+
- name: Install Python
24+
uses: actions/setup-python@v4
25+
with:
26+
python-version: "3.9"
27+
28+
- name: Install upgrade-codeql-dependencies.py dependencies
29+
run: pip install -r scripts/upgrade-codeql-dependencies/requirements.txt
30+
2831
- name: Update the supported environment
32+
env:
33+
GITHUB_TOKEN: ${{ github.token }}
34+
CODEQL_CLI_VERSION: ${{ github.event.inputs.codeql_cli_version }}
2935
run: |
30-
jq \
31-
--arg cli_version "$CODEQL_CLI_VERSION" \
32-
--arg standard_library_commit "$CODEQL_LIB_COMMIT" \
33-
--raw-output \
34-
'.supported_environment | .[0] | .codeql_cli = $cli_version | .codeql_standard_library = $standard_library_commit' \
35-
supported_codeql_configs.json
36+
scripts/upgrade-codeql-dependencies/upgrade_codeql_dependencies.py --cli-version "$CODEQL_CLI_VERSION"
3637
3738
- name: Fetch CodeQL
3839
env:
@@ -54,4 +55,4 @@ jobs:
5455
commit-message: "Upgrading `github/codeql` dependency to ${{ github.event.inputs.codeql_standard_library_commit }}"
5556
team-reviewers: github/codeql-coding-standards
5657
delete-branch: true
57-
branch: "codeql/upgrade-to-${{ github.event.inputs.codeql_standard_library_commit }}-${{ github.event.inputs.codeql_cli_version }}"
58+
branch: "codeql/upgrade-to-${{ github.event.inputs.codeql_cli_version }}"

0 commit comments

Comments
 (0)