Skip to content

Commit 5ba35e3

Browse files
Copilotneilime
andcommitted
docs: describe scalar registry inputs as default
Co-authored-by: neilime <314088+neilime@users.noreply.github.com>
1 parent b843de7 commit 5ba35e3

6 files changed

Lines changed: 24 additions & 24 deletions

File tree

.github/workflows/docker-build-images.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ jobs:
216216

217217
## Multiple registries
218218

219-
The legacy single-registry format still works:
219+
The default single-registry format still works:
220220

221221
```yaml
222222
with:

.github/workflows/docker-build-images.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ on: # yamllint disable-line rule:truthy
1717
oci-registry:
1818
description: |
1919
OCI registry configuration used to pull, push and cache images.
20-
Accepts either a registry hostname string (legacy format) or a JSON object.
20+
Accepts either a registry hostname string (default format) or a JSON object.
2121
JSON example: `{"pull":"docker.io","pull:private":"ghcr.io","push":"ghcr.io"}`
2222
JSON object keys:
2323
- `pull`: registry used to pull public or default base images
@@ -31,7 +31,7 @@ on: # yamllint disable-line rule:truthy
3131
oci-registry-username:
3232
description: |
3333
Username configuration used to log against OCI registries.
34-
Accepts either a single username string (legacy format) or a JSON object using the same keys as `oci-registry`.
34+
Accepts either a single username string (default format) or a JSON object using the same keys as `oci-registry`.
3535
JSON example: `{"pull:private":"my-user","push":"my-user"}`
3636
See https://github.com/docker/login-action#usage.
3737
type: string
@@ -115,7 +115,7 @@ on: # yamllint disable-line rule:truthy
115115
oci-registry-password:
116116
description: |
117117
Password or GitHub token (`packages:read` and `packages:write` scopes) configuration used to log against OCI registries.
118-
Accepts either a single password/token string (legacy format) or a JSON object using the same keys as `oci-registry`.
118+
Accepts either a single password/token string (default format) or a JSON object using the same keys as `oci-registry`.
119119
JSON example: `{"pull:private":"my-token","push":"my-token"}`
120120
See https://github.com/docker/login-action#usage.
121121
required: true

actions/docker/build-image/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ permissions:
206206

207207
## Multiple registries
208208

209-
The legacy single-registry format still works:
209+
The default single-registry format still works:
210210

211211
```yaml
212212
oci-registry: ghcr.io

actions/docker/build-image/action.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ inputs:
1414
oci-registry:
1515
description: |
1616
OCI registry configuration used to pull, push and cache images.
17-
Accepts either a registry hostname string (legacy format) or a JSON object.
17+
Accepts either a registry hostname string (default format) or a JSON object.
1818
JSON example: `{"pull":"docker.io","pull:private":"ghcr.io","push":"ghcr.io"}`
1919
JSON object keys:
2020
- `pull`: registry used to pull public or default base images
@@ -27,15 +27,15 @@ inputs:
2727
oci-registry-username:
2828
description: |
2929
Username configuration used to log against OCI registries.
30-
Accepts either a single username string (legacy format) or a JSON object using the same keys as `oci-registry`.
30+
Accepts either a single username string (default format) or a JSON object using the same keys as `oci-registry`.
3131
JSON example: `{"pull:private":"${{ github.repository_owner }}","push":"${{ github.repository_owner }}"}`
3232
See https://github.com/docker/login-action#usage.
3333
default: ${{ github.repository_owner }}
3434
required: true
3535
oci-registry-password:
3636
description: |
3737
Password or personal access token configuration used to log against OCI registries.
38-
Accepts either a single password/token string (legacy format) or a JSON object using the same keys as `oci-registry`.
38+
Accepts either a single password/token string (default format) or a JSON object using the same keys as `oci-registry`.
3939
JSON example: `{"pull:private":"${{ github.token }}","push":"${{ github.token }}"}`
4040
Can be passed in using `secrets.GITHUB_TOKEN`.
4141
See https://github.com/docker/login-action#usage.
@@ -199,7 +199,7 @@ runs:
199199
}
200200
201201
if (typeof parsedValue === 'string') {
202-
return { legacy: normalizeString(parsedValue, inputName) };
202+
return { scalar: normalizeString(parsedValue, inputName) };
203203
}
204204
205205
return Object.entries(parsedValue).reduce((roleMap, [key, value]) => {
@@ -213,18 +213,18 @@ runs:
213213
}
214214
215215
function resolveCredentialByRole(credentialMap, role, registry, pushRegistry) {
216-
const legacyCredential = credentialMap.legacy ?? '';
216+
const defaultCredential = credentialMap.scalar ?? '';
217217
218218
if (role === 'push') {
219-
return credentialMap.push ?? legacyCredential;
219+
return credentialMap.push ?? defaultCredential;
220220
}
221221
222222
if (role === 'cache') {
223-
return credentialMap.cache ?? credentialMap.push ?? legacyCredential;
223+
return credentialMap.cache ?? credentialMap.push ?? defaultCredential;
224224
}
225225
226226
if (!isPullRole(role)) {
227-
return legacyCredential;
227+
return defaultCredential;
228228
}
229229
230230
if (credentialMap[role] !== undefined) {
@@ -239,7 +239,7 @@ runs:
239239
return credentialMap.push;
240240
}
241241
242-
return legacyCredential;
242+
return defaultCredential;
243243
}
244244
245245
const registryInput = normalizeRoleMapInput('oci-registry', `${{ inputs.oci-registry }}`);
@@ -249,8 +249,8 @@ runs:
249249
let pullRegistryEntries = [];
250250
let pullRegistries = [];
251251
252-
if (registryInput.legacy) {
253-
pushRegistry = registryInput.legacy;
252+
if (registryInput.scalar) {
253+
pushRegistry = registryInput.scalar;
254254
cacheRegistry = pushRegistry;
255255
pullRegistries = [pushRegistry];
256256
} else {

actions/docker/create-images-manifests/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ permissions:
142142

143143
## Multiple registries
144144

145-
The legacy single-registry format still works:
145+
The default single-registry format still works:
146146

147147
```yaml
148148
oci-registry: ghcr.io

actions/docker/create-images-manifests/action.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ inputs:
1414
oci-registry:
1515
description: |
1616
OCI registry configuration used to pull, push and cache images.
17-
Accepts either a registry hostname string (legacy format) or a JSON object.
17+
Accepts either a registry hostname string (default format) or a JSON object.
1818
JSON example: `{"pull":"docker.io","pull:private":"ghcr.io","push":"ghcr.io"}`
1919
JSON object keys:
2020
- `pull`: registry used to pull public or default base images
@@ -26,15 +26,15 @@ inputs:
2626
oci-registry-username:
2727
description: |
2828
Username configuration used to log against OCI registries.
29-
Accepts either a single username string (legacy format) or a JSON object using the same keys as `oci-registry`.
29+
Accepts either a single username string (default format) or a JSON object using the same keys as `oci-registry`.
3030
JSON example: `{"pull:private":"${{ github.repository_owner }}","push":"${{ github.repository_owner }}"}`
3131
See https://github.com/docker/login-action#usage.
3232
default: ${{ github.repository_owner }}
3333
required: true
3434
oci-registry-password:
3535
description: |
3636
Password or personal access token configuration used to log against OCI registries.
37-
Accepts either a single password/token string (legacy format) or a JSON object using the same keys as `oci-registry`.
37+
Accepts either a single password/token string (default format) or a JSON object using the same keys as `oci-registry`.
3838
JSON example: `{"pull:private":"${{ github.token }}","push":"${{ github.token }}"}`
3939
Can be passed in using `secrets.GITHUB_TOKEN`.
4040
See https://github.com/docker/login-action#usage.
@@ -157,7 +157,7 @@ runs:
157157
}
158158
159159
if (typeof parsedValue === 'string') {
160-
return { legacy: normalizeString(parsedValue, inputName) };
160+
return { scalar: normalizeString(parsedValue, inputName) };
161161
}
162162
163163
return Object.entries(parsedValue).reduce((roleMap, [key, value]) => {
@@ -171,7 +171,7 @@ runs:
171171
}
172172
173173
function resolvePushCredential(credentialMap) {
174-
return credentialMap.push ?? credentialMap.legacy ?? '';
174+
return credentialMap.push ?? credentialMap.scalar ?? '';
175175
}
176176
177177
const builtImagesInput = `${{ inputs.built-images }}`;
@@ -207,8 +207,8 @@ runs:
207207
if (!registries.length) {
208208
const registryInputName = ['oci', 'registry'].join('-');
209209
const registryInput = normalizeRoleMapInput(registryInputName, `${{ inputs.oci-registry }}`);
210-
if (registryInput.legacy) {
211-
registries.push(registryInput.legacy);
210+
if (registryInput.scalar) {
211+
registries.push(registryInput.scalar);
212212
} else {
213213
const [, firstPullRegistryValue] = Object.entries(registryInput).find(([key]) => isPullRole(key)) ?? [];
214214
const pushRegistry = registryInput.push ?? registryInput.cache ?? firstPullRegistryValue ?? '';

0 commit comments

Comments
 (0)