|
| 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-query-filters1.yml |
| 16 | + registries-auth-tokens: https://ghcr.io/v2=${{ secrets.GITHUB_TOKEN }} |
| 17 | + # ensure test will fail if registries block is not used |
| 18 | + token: i-am-not-a-token |
| 19 | + env: |
| 20 | + TEST_MODE: true |
| 21 | + # ensure test will fail if registries block is not used |
| 22 | + GITHUB_TOKEN: i-am-not-a-token |
| 23 | + - name: Verify packages installed |
| 24 | + run: | |
| 25 | + PRIVATE_PACK="$HOME/.codeql/packages/dsp-testing/private-pack" |
| 26 | + CODEQL_PACK1="$HOME/.codeql/packages/dsp-testing/codeql-pack1" |
| 27 | +
|
| 28 | + if [[ -d $PRIVATE_PACK ]] |
| 29 | + then |
| 30 | + echo "$PRIVATE_PACK was installed." |
| 31 | + else |
| 32 | + echo "::error $PRIVATE_PACK pack was not installed." |
| 33 | + exit 1 |
| 34 | + fi |
| 35 | +
|
| 36 | + if [[ -d $CODEQL_PACK1 ]] |
| 37 | + then |
| 38 | + echo "$CODEQL_PACK1 was installed." |
| 39 | + else |
| 40 | + echo "::error $CODEQL_PACK1 pack was not installed." |
| 41 | + exit 1 |
| 42 | + fi |
0 commit comments