Skip to content

Commit f7c704a

Browse files
Third try fixing CI/CD
1 parent a94a2d6 commit f7c704a

2 files changed

Lines changed: 24 additions & 1 deletion

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ runs:
2222
CODEQL_CLI: ${{ inputs.cli_path }}
2323
run: |
2424
PATH=$PATH:$CODEQL_CLI
25-
python scripts/install-packs.py --mode ${{ inputs.mode }}
25+
python .github/scripts/install-packs.py --mode ${{ inputs.mode }}

.github/scripts/install-packs.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import argparse
2+
import os
3+
import subprocess
4+
import get_workspace_packs
5+
6+
parser = argparse.ArgumentParser(description="Install CodeQL library pack dependencies.")
7+
parser.add_argument('--mode', required=False, choices=['use-lock', 'update', 'verify', 'no-lock'], default="use-lock", help="Installation mode, identical to the `--mode` argument to `codeql pack install`")
8+
parser.add_argument('--codeql', required=False, default='codeql', help="Path to the `codeql` executable.")
9+
args = parser.parse_args()
10+
11+
# Find the root of the repo
12+
root = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
13+
14+
packs = get_workspace_packs.get_workspace_packs(root)
15+
16+
# Find the CodeQL packs in the repo. This can also return packs outside of the repo, if those packs
17+
# are installed in a sibling directory to the CLI.
18+
for pack in packs:
19+
pack_path = os.path.join(root, pack)
20+
# Run `codeql pack install` to install dependencies.
21+
command = [args.codeql, 'pack', 'install', '--allow-prerelease', '--mode', args.mode, pack_path]
22+
print(f'Running `{" ".join(command)}`')
23+
subprocess.check_call(command)

0 commit comments

Comments
 (0)