Skip to content

Commit fc8730b

Browse files
committed
Refactor action.yml and README.md to replace deprecated registry-token inputs with registry-password, enhancing clarity and consistency in authentication methods for multiple registries.
1 parent 41e641d commit fc8730b

File tree

2 files changed

+17
-13
lines changed

2 files changed

+17
-13
lines changed

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,12 @@ jobs:
9494
# Registry 2: GitHub Container Registry
9595
registry-2: "ghcr.io"
9696
registry-username-2: ${{ github.actor }}
97-
registry-token-2: ${{ secrets.GITHUB_TOKEN }}
97+
registry-password-2: ${{ secrets.GITHUB_TOKEN }}
9898

9999
# Registry 3: Custom Private Registry
100100
registry-3: "registry.example.com"
101101
registry-username-3: ${{ secrets.CUSTOM_REGISTRY_USER }}
102-
registry-token-3: ${{ secrets.CUSTOM_REGISTRY_TOKEN }}
102+
registry-password-3: ${{ secrets.CUSTOM_REGISTRY_TOKEN }}
103103

104104
platforms: "linux/amd64,linux/arm64"
105105
```
@@ -111,7 +111,8 @@ jobs:
111111
tags|Enter the tag(s) you would like to name your image with. (example: `myorg/myapp:production`) Use multi-line format for multiple tags.|⚠️ Yes|
112112
registry|Choose which container image repository to upload to. <a href="https://github.com/docker/login-action#usage">See all options.</a>| |`docker.io`
113113
registry-username|Enter the username to authenticate with your first registry.|⚠️ Yes|
114-
registry-token|Enter the token or password to authenticate with your first registry. (an access token is highly recommended)|⚠️ Yes|
114+
registry-token (deprecated)| Use `registry-password` instead||
115+
registry-password|Enter the password or token to authenticate with your registry. (an access token is highly recommended)|⚠️ Yes|
115116
context|The relative path to the Dockerfile.| |`.`
116117
dockerfile|Filename of the Dockerfile within the context that you set.| |`./Dockerfile`
117118
platforms|Comma separated list of <a href="https://github.com/docker-library/official-images#architectures-other-than-amd64">platforms</a>.| |`linux/amd64`
@@ -122,10 +123,10 @@ target|The target build stage to build.| |
122123
:-----:|:-----:|:-----:|:-----:
123124
registry-2|Choose which container image repository to upload to. <a href="https://github.com/docker/login-action#usage">See all options.</a>| |
124125
registry-username-2|Enter the username to authenticate with your second registry.|⚠️ Yes (if you use the 2nd registry)|
125-
registry-token-2|Enter the token or password to authenticate with your second registry. (an access token is highly recommended)|⚠️ Yes (if you use the 2nd registry)|
126+
registry-password-2|Enter the token or password to authenticate with your second registry. (an access token is highly recommended)|⚠️ Yes (if you use the 2nd registry)|
126127
registry-3|Choose which container image repository to upload to. <a href="https://github.com/docker/login-action#usage">See all options.</a>| |
127128
registry-username-3|Enter the username to authenticate with your third registry.|⚠️ Yes (if you use the 3rd registry)|
128-
registry-token-3|Enter the token or password to authenticate with your third registry. (an access token is highly recommended)|⚠️ Yes (if you use the 3rd registry)|
129+
registry-password-3|Enter the token or password to authenticate with your third registry. (an access token is highly recommended)|⚠️ Yes (if you use the 3rd registry)|
129130

130131
> [!NOTE]
131132
> At least one registry's credentials must be provided (either registry 1, 2, or 3).

action.yml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@ inputs:
77
registry-username:
88
description: 'Enter the username to authenticate with your registry.'
99
default: ''
10+
registry-password:
11+
description: 'Enter the password or token to authenticate with your registry. (an access token is highly recommended)'
12+
default: ''
1013
registry-token:
11-
description: 'Enter the token or password to authenticate with your registry. (an access token is highly recommended)'
14+
description: '[DEPRECATED - Use registry-password instead] Enter the token or password to authenticate with your registry. (an access token is highly recommended)'
1215
default: ''
1316
registry:
1417
description: 'Registry to authenticate with (e.g., "docker.io" or "ghcr.io").'
@@ -17,15 +20,15 @@ inputs:
1720
registry-username-2:
1821
description: 'Enter the username to authenticate with your registry.'
1922
default: ''
20-
registry-token-2:
23+
registry-password-2:
2124
description: 'Enter the token or password to authenticate with your registry. (an access token is highly recommended)'
2225
default: ''
2326
registry-2:
2427
description: 'Registry to authenticate with (e.g., "docker.io" or "ghcr.io").'
2528
registry-username-3:
2629
description: 'Enter the username to authenticate with your registry.'
2730
default: ''
28-
registry-token-3:
31+
registry-password-3:
2932
description: 'Enter the token or password to authenticate with your registry. (an access token is highly recommended)'
3033
default: ''
3134
registry-3:
@@ -54,23 +57,23 @@ runs:
5457
uses: docker/login-action@v3
5558
with:
5659
username: ${{ inputs.registry-username }}
57-
password: ${{ inputs.registry-token }}
60+
password: ${{ inputs.registry-password || inputs.registry-token }}
5861
registry: ${{ inputs.registry }}
5962

60-
- name: Login to Container Registry ({{ inputs.registry-2 }})
63+
- name: "Login to Container Registry #2 ({{ inputs.registry-2 }})"
6164
if: inputs.registry-2-username != ''
6265
uses: docker/login-action@v3
6366
with:
6467
username: ${{ inputs.registry-username-2 }}
65-
password: ${{ inputs.registry-token-2 }}
68+
password: ${{ inputs.registry-password-2 }}
6669
registry: ${{ inputs.registry-2 }}
6770

68-
- name: Login to Container Registry ({{ inputs.registry-3 }})
71+
- name: "Login to Container Registry #3 ({{ inputs.registry-3 }})"
6972
if: inputs.registry-3-username != ''
7073
uses: docker/login-action@v3
7174
with:
7275
username: ${{ inputs.registry-username-3 }}
73-
password: ${{ inputs.registry-token-3 }}
76+
password: ${{ inputs.registry-password-3 }}
7477
registry: ${{ inputs.registry-3 }}
7578

7679
- name: Set up QEMU

0 commit comments

Comments
 (0)