You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* feat: change the default value of mask-password to true
BREAKING CHANGE: The default value of the 'mask-password' input has been updated from false to true.
* Treat maskPassword as false only if explicitly set to false
* Add new-v2-release to README
Copy file name to clipboardExpand all lines: README.md
+36-22Lines changed: 36 additions & 22 deletions
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,7 @@ Logs in the local Docker client to one or more Amazon ECR Private registries or
6
6
7
7
<!-- toc -->
8
8
9
+
-[New v2 Release](#new-v2-release)
9
10
-[Example of Usage](#examples-of-usage)
10
11
-[Building and pushing an image](#building-and-pushing-an-image)
11
12
-[Using an image as a service](#using-an-image-as-a-service)
@@ -23,6 +24,28 @@ Logs in the local Docker client to one or more Amazon ECR Private registries or
23
24
24
25
<!-- tocstop -->
25
26
27
+
## New v2 Release
28
+
29
+
In the new major version for this action, the default value of the `mask-password` input has changed from `false` to `true`.
30
+
31
+
If you are **not** consuming the Docker credentials as outputs in subsequent jobs, you can simply update your action version to `aws-actions/amazon-ecr-login@v2`.
32
+
33
+
For any customer consuming the Docker credentials as outputs in subsequent jobs:
34
+
35
+
- If you are relying on the default value of the `mask-password` input, which is currently `false` in v1, your workflow will break when upgrading to v2. To fix this, please set the mask-password input to `false`:
36
+
37
+
```
38
+
- name: Login to Amazon ECR
39
+
id: login-ecr
40
+
uses: aws-actions/amazon-ecr-login@v2
41
+
with:
42
+
mask-password: 'false'
43
+
```
44
+
45
+
- If you are already setting the `mask-password` input to `false`, you can simply update your action version to `aws-actions/amazon-ecr-login@v2`.
46
+
47
+
For more information on why this change is being made, see [Masking Docker Credentials in Amazon ECR Login Action](https://github.com/aws-actions/amazon-ecr-login/issues/526).
48
+
26
49
## Examples of Usage
27
50
28
51
### Building and pushing an image
@@ -43,9 +66,7 @@ Logs in the local Docker client to one or more Amazon ECR Private registries or
43
66
```yaml
44
67
- name: Login to Amazon ECR
45
68
id: login-ecr
46
-
uses: aws-actions/amazon-ecr-login@v1
47
-
with:
48
-
mask-password: 'true'
69
+
uses: aws-actions/amazon-ecr-login@v2
49
70
50
71
- name: Build, tag, and push docker image to Amazon ECR
51
72
env:
@@ -61,9 +82,8 @@ Logs in the local Docker client to one or more Amazon ECR Private registries or
61
82
```yaml
62
83
- name: Login to Amazon ECR Public
63
84
id: login-ecr-public
64
-
uses: aws-actions/amazon-ecr-login@v1
85
+
uses: aws-actions/amazon-ecr-login@v2
65
86
with:
66
-
mask-password: 'true'
67
87
registry-type: public
68
88
69
89
- name: Build, tag, and push docker image to Amazon ECR Public
@@ -81,9 +101,7 @@ Logs in the local Docker client to one or more Amazon ECR Private registries or
81
101
```yaml
82
102
- name: Login to Amazon ECR
83
103
id: login-ecr
84
-
uses: aws-actions/amazon-ecr-login@v1
85
-
with:
86
-
mask-password: 'true'
104
+
uses: aws-actions/amazon-ecr-login@v2
87
105
88
106
- name: Package and push helm chart to Amazon ECR
89
107
env:
@@ -98,9 +116,8 @@ Logs in the local Docker client to one or more Amazon ECR Private registries or
98
116
```yaml
99
117
- name: Login to Amazon ECR Public
100
118
id: login-ecr-public
101
-
uses: aws-actions/amazon-ecr-login@v1
119
+
uses: aws-actions/amazon-ecr-login@v2
102
120
with:
103
-
mask-password: 'true'
104
121
registry-type: public
105
122
106
123
- name: Package and push helm chart to Amazon ECR Public
@@ -115,11 +132,6 @@ Logs in the local Docker client to one or more Amazon ECR Private registries or
115
132
116
133
Helm uses the same credential store as Docker, so Helm can authenticate with the same credentials that you use for Docker.
117
134
118
-
> [!WARNING]
119
-
> Setting `mask-password` to `'true'` is the recommended approach if following any of the examples above.
120
-
> However, this will prevent the Docker password output from being shared between separate jobs.
121
-
> For more information, see the [Docker Credentials](#docker-credentials) section below.
122
-
123
135
### Other use-cases
124
136
125
137
#### Login to ECR on multiple AWS accounts
@@ -133,7 +145,7 @@ Helm uses the same credential store as Docker, so Helm can authenticate with the
133
145
134
146
- name: Login to Amazon ECR
135
147
id: login-ecr
136
-
uses: aws-actions/amazon-ecr-login@v1
148
+
uses: aws-actions/amazon-ecr-login@v2
137
149
with:
138
150
registries: "123456789012,998877665544"
139
151
```
@@ -149,7 +161,7 @@ for details on how to configure ECR policies
149
161
Use the action to output your Docker credentials for logging into ECR Private, then use the credentials to run your private image as a service in another job.
150
162
151
163
> [!WARNING]
152
-
> Not setting `mask-password` or setting `mask-password` to `'false'` will log your Docker password output if [debug logging is enabled](https://docs.github.com/en/actions/monitoring-and-troubleshooting-workflows/enabling-debug-logging).
164
+
> Setting `mask-password` to `'false'` will log your Docker password output if [debug logging is enabled](https://docs.github.com/en/actions/monitoring-and-troubleshooting-workflows/enabling-debug-logging).
153
165
> For more information, see the [Docker Credentials](#docker-credentials) section below.
154
166
155
167
```yaml
@@ -165,7 +177,9 @@ jobs:
165
177
mask-aws-account-id: 'false'
166
178
- name: Login to Amazon ECR
167
179
id: login-ecr
168
-
uses: aws-actions/amazon-ecr-login@v1
180
+
uses: aws-actions/amazon-ecr-login@v2
181
+
with:
182
+
mask-password: 'false'
169
183
outputs:
170
184
registry: ${{ steps.login-ecr.outputs.registry }}
171
185
docker_username: ${{ steps.login-ecr.outputs.docker_username_123456789012_dkr_ecr_us_east_1_amazonaws_com }} # More information on these outputs can be found below in the 'Docker Credentials' section
@@ -205,7 +219,7 @@ This action relies on the [default behavior of the AWS SDK for Javascript](https
205
219
206
220
- name: Login to Amazon ECR Private
207
221
id: login-ecr
208
-
uses: aws-actions/amazon-ecr-login@v1
222
+
uses: aws-actions/amazon-ecr-login@v2
209
223
```
210
224
211
225
We recommend following [Amazon IAM best practices](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html) when using AWS services in GitHub Actions workflows, including:
> If **you are not** using the Docker credential outputs, make sure the `mask-password` input is **set to `'true'`**.
246
+
> If **you are not** using the Docker credential outputs, make sure the `mask-password` input is **not set or set to `'true'`**.
233
247
> This masks your Docker password and prevents it from being printed to the action logs if you [enable debug logging](https://docs.github.com/en/actions/monitoring-and-troubleshooting-workflows/enabling-debug-logging).
234
248
>
235
-
> If **you are** using the Docker credential outputs, make sure the `mask-password` input is **not set or set to `'false'`**.
249
+
> If **you are** using the Docker credential outputs, make sure the `mask-password` input is **set to `'false'`**.
236
250
> Masked values cannot be passed to separate jobs (see [this issue](https://github.com/actions/runner/issues/1498#issuecomment-1066836352)).
237
251
238
252
## Self-Hosted Runners
@@ -245,7 +259,7 @@ Additionally, this action will always consider an already configured proxy in th
0 commit comments