|
4 | 4 | # basic mechanics of multi-registry auth is working.
|
5 | 5 | name: "Packaging: Download using registries"
|
6 | 6 | description: "Checks that specifying a registries block and associated auth works as expected"
|
7 |
| -versions: ["nightly-latest"] # This feature is not compatible with old CLIs |
| 7 | +versions: [ |
| 8 | + # This feature is not compatible with older CLIs |
| 9 | + "cached", |
| 10 | + "latest", |
| 11 | + "nightly-latest", |
| 12 | +] |
| 13 | + |
| 14 | +env: |
| 15 | + CODEQL_PASS_CONFIG_TO_CLI: 'true' |
8 | 16 |
|
9 | 17 | steps:
|
10 | 18 | - name: Init with registries
|
@@ -40,3 +48,33 @@ steps:
|
40 | 48 | echo "::error $CODEQL_PACK1 pack was not installed."
|
41 | 49 | exit 1
|
42 | 50 | fi
|
| 51 | +
|
| 52 | + - name: Verify qlconfig.yml file was created |
| 53 | + shell: bash |
| 54 | + run: | |
| 55 | + QLCONFIG_PATH=$RUNNER_TEMP/qlconfig.yml |
| 56 | + echo "Expected qlconfig.yml file to be created at $QLCONFIG_PATH" |
| 57 | + if [[ -f $QLCONFIG_PATH ]] |
| 58 | + then |
| 59 | + echo "qlconfig.yml file was created." |
| 60 | + else |
| 61 | + echo "::error qlconfig.yml file was not created." |
| 62 | + exit 1 |
| 63 | + fi |
| 64 | +
|
| 65 | + - name: Verify contents of qlconfig.yml |
| 66 | + # yq is not available on windows |
| 67 | + if: runner.os != 'Windows' |
| 68 | + shell: bash |
| 69 | + run: | |
| 70 | + QLCONFIG_PATH=$RUNNER_TEMP/qlconfig.yml |
| 71 | + cat $QLCONFIG_PATH | yq -e '.registries[] | select(.url == "https://ghcr.io/v2/") | select(.packages == "*/*")' |
| 72 | + if [[ $? -eq 0 ]] |
| 73 | + then |
| 74 | + echo "Registry was added to qlconfig.yml file." |
| 75 | + else |
| 76 | + echo "::error Registry was not added to qlconfig.yml file." |
| 77 | + echo "Contents of qlconfig.yml file:" |
| 78 | + cat $QLCONFIG_PATH |
| 79 | + exit 1 |
| 80 | + fi |
0 commit comments