Clarify description of registries input

This commit is contained in:
Andrew Eisenberg 2022-09-06 10:45:02 -07:00
parent bf97a6da5b
commit 376fea671d
6 changed files with 12 additions and 14 deletions

View file

@ -66,13 +66,9 @@ jobs:
config-file: ./.github/codeql/codeql-config-registries.yml config-file: ./.github/codeql/codeql-config-registries.yml
languages: javascript languages: javascript
registries: | registries: |
[ - url: "https://ghcr.io/v2/"
{ packages: "*/*"
"url": "https://ghcr.io/v2/", token: "${{ secrets.GITHUB_TOKEN }}"
"packages": "*/*",
"token": "${{ secrets.GITHUB_TOKEN }}"
}
]
env: env:
TEST_MODE: true TEST_MODE: true

View file

@ -15,6 +15,8 @@ inputs:
required: false required: false
registries: registries:
description: | description: |
Use this input only when you need to download CodeQL packages from another instance of GitHub. If you only need to download packages from this GitHub instance, use the token input instead.
A YAML string that defines the list of GitHub container registries to use for downloading packs. The string is in the following form (the | is required on the first line): A YAML string that defines the list of GitHub container registries to use for downloading packs. The string is in the following form (the | is required on the first line):
registries: | registries: |
@ -22,11 +24,11 @@ inputs:
packages: packages:
- my-company/* - my-company/*
- my-company2/* - my-company2/*
token: ${{ secrets.GHEHOSTNAME1_TOKEN }} token: \$\{{ secrets.GHEHOSTNAME1_TOKEN }}
- url: https://ghcr.io/v2/ - url: https://ghcr.io/v2/
packages: */* packages: */*
token: ${{ secrets.GHCR_TOKEN }} token: \$\{{ secrets.GHCR_TOKEN }}
The url property contains the URL to the container registry you want to connect to. The url property contains the URL to the container registry you want to connect to.

View file

@ -1139,7 +1139,7 @@ const calculateAugmentationErrorMacro = ava_1.default.macro({
t.deepEqual(configFile, expectedConfigFile); t.deepEqual(configFile, expectedConfigFile);
// verify the env vars were set correctly // verify the env vars were set correctly
t.deepEqual(process.env.GITHUB_TOKEN, sampleApiDetails.auth); t.deepEqual(process.env.GITHUB_TOKEN, sampleApiDetails.auth);
t.deepEqual(process.env.CODEQL_REGISTRIES_AUTH, "http://ghcr.io=not-a-token,https://containers.GHEHOSTNAME1/v2/=still-a-token"); t.deepEqual(process.env.CODEQL_REGISTRIES_AUTH, "http://ghcr.io=not-a-token,https://containers.GHEHOSTNAME1/v2/=still-not-a-token");
// verify the config file contents were set correctly // verify the config file contents were set correctly
const config = yaml.load(fs.readFileSync(configFile, "utf8")); const config = yaml.load(fs.readFileSync(configFile, "utf8"));
t.deepEqual(config.registries, registries.map((r) => ({ url: r.url, packages: r.packages }))); t.deepEqual(config.registries, registries.map((r) => ({ url: r.url, packages: r.packages })));

File diff suppressed because one or more lines are too long

View file

@ -15,8 +15,8 @@ steps:
config-file: ./.github/codeql/codeql-config-registries.yml config-file: ./.github/codeql/codeql-config-registries.yml
languages: javascript languages: javascript
registries: | registries: |
- url: "https://ghcr.io/v2/", - url: "https://ghcr.io/v2/"
packages: "*/*", packages: "*/*"
token: "${{ secrets.GITHUB_TOKEN }}" token: "${{ secrets.GITHUB_TOKEN }}"
env: env:

View file

@ -2296,7 +2296,7 @@ test("downloadPacks-with-registries", async (t) => {
t.deepEqual(process.env.GITHUB_TOKEN, sampleApiDetails.auth); t.deepEqual(process.env.GITHUB_TOKEN, sampleApiDetails.auth);
t.deepEqual( t.deepEqual(
process.env.CODEQL_REGISTRIES_AUTH, process.env.CODEQL_REGISTRIES_AUTH,
"http://ghcr.io=not-a-token,https://containers.GHEHOSTNAME1/v2/=still-a-token" "http://ghcr.io=not-a-token,https://containers.GHEHOSTNAME1/v2/=still-not-a-token"
); );
// verify the config file contents were set correctly // verify the config file contents were set correctly