Skip to content

Commit

Permalink
Showing 5 changed files with 26 additions and 14 deletions.
24 changes: 20 additions & 4 deletions init/action.yml
@@ -10,15 +10,31 @@ inputs:
description: The languages to be analysed
required: false
token:
description: GitHub token to use for authenticating with this instance of GitHub. To download custom packs from multiple registries, use registries-auth-tokens.
description: GitHub token to use for authenticating with this instance of GitHub. To download custom packs from multiple registries, use the registries input.
default: ${{ github.token }}
required: false
registries:
description: |
Authenticate to GitHub Enterprise Server Container registries by passing a comma-separated list of <registry_url>=<token> pairs.
A YAML string that defines the list of GitHub container registries to use for downloading packs. The string is in the following forma (the | is required on the first line):
For example, you can pass `https://containers.GHEHOSTNAME1/v2/=TOKEN1,https://containers.GHEHOSTNAME2/v2/=TOKEN2`` to authenticate to two GitHub Enterprise Server instances.
This overrides the `token` input for pack downloads.
registries: |
- url: https://containers.GHEHOSTNAME1/v2/
packages:
- my-company/*
- my-company2/*
token: ${{ secrets.GHEHOSTNAME1_TOKEN }}
- url: https://ghcr.io/v2/
packages: */*
token: ${{ secrets.GHCR_TOKEN }}
The url property contains the url to the container registry you want to connect to.
The packages property contains a single entry or a list of globs specifying packages that can be found in the container registry. Order is important. Earlier entries will match before later entries.
The token property contains a connection token for this registry.
If this input is missing, the `token` input is used for all pack downloads.
required: false
matrix:
default: ${{ toJson(matrix) }}
2 changes: 1 addition & 1 deletion lib/config-utils.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/config-utils.js.map

Large diffs are not rendered by default.

10 changes: 3 additions & 7 deletions pr-checks/checks/init-with-registries.yml
@@ -15,13 +15,9 @@ steps:
config-file: ./.github/codeql/codeql-config-registries.yml
languages: javascript
registries: |
[
{
"url": "https://ghcr.io/v2/",
"packages": "*/*",
"token": "${{ secrets.GITHUB_TOKEN }}"
}
]
- url: "https://ghcr.io/v2/",
packages: "*/*",
token: "${{ secrets.GITHUB_TOKEN }}"
env:
TEST_MODE: true
2 changes: 1 addition & 1 deletion src/config-utils.ts
@@ -1723,7 +1723,7 @@ export async function initConfig(

function parseRegistries(registriesInput: string | undefined) {
try {
return registriesInput ? JSON.parse(registriesInput) : undefined;
return registriesInput ? yaml.l(registriesInput) : undefined;
} catch (e) {
throw new Error(
`Invalid registries input. Must be a JSON string, but got: ${

0 comments on commit abdf26c

Please sign in to comment.