Skip to content

Commit 1d92118

Browse files
committed
Add integration test for using registries-auth-tokens
1 parent 0e98efa commit 1d92118

File tree

3 files changed

+145
-0
lines changed

3 files changed

+145
-0
lines changed

.github/workflows/__init-with-registries.yml

Lines changed: 93 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# A test for running the init command with a registries block.
2+
# This test does _not_ validate that the action can authenticate
3+
# against multiple registries. All it does is validate that the
4+
# basic mechanics of multi-registry auth is working.
5+
name: "Packaging: Download using registries"
6+
description: "Checks that specifying a registries block and associated auth works as expected"
7+
versions: ["latest", "cached", "nightly-latest"] # This feature is not compatible with old CLIs
8+
9+
steps:
10+
- name: Init with registries-auth-tokens
11+
uses: ./../action/init
12+
with:
13+
db-location: "${{ runner.temp }}/customDbLocation"
14+
tools: ${{ steps.prepare-test.outputs.tools-url }}
15+
config-file: ./.github/codeql/codeql-config-registries.yml
16+
languages: javascript
17+
registries-auth-tokens: https://ghcr.io/v2/=${{ secrets.GITHUB_TOKEN }}
18+
env:
19+
TEST_MODE: true
20+
- name: Verify packages installed
21+
shell: bash
22+
run: |
23+
PRIVATE_PACK="$HOME/.codeql/packages/dsp-testing/private-pack"
24+
CODEQL_PACK1="$HOME/.codeql/packages/dsp-testing/codeql-pack1"
25+
26+
if [[ -d $PRIVATE_PACK ]]
27+
then
28+
echo "$PRIVATE_PACK was installed."
29+
else
30+
echo "::error $PRIVATE_PACK pack was not installed."
31+
exit 1
32+
fi
33+
34+
if [[ -d $CODEQL_PACK1 ]]
35+
then
36+
echo "$CODEQL_PACK1 was installed."
37+
else
38+
echo "::error $CODEQL_PACK1 pack was not installed."
39+
exit 1
40+
fi
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: Pack testing in the CodeQL Action
2+
3+
disable-default-queries: true
4+
packs:
5+
javascript:
6+
- dsp-testing/private-pack
7+
- dsp-testing/codeql-pack1
8+
9+
registries:
10+
# enforce using the registries block for all packs
11+
- url: https://ghcr.io/v2/
12+
packages: "*"

0 commit comments

Comments
 (0)