mirror of
https://github.com/docker/login-action.git
synced 2026-05-31 08:37:53 +00:00
Compare commits
59 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3999a1f436 | |||
| 0c083d7a7a | |||
| d74126fafb | |||
| 008abcd773 | |||
| b3d0cb50ae | |||
| d1f19df6c2 | |||
| f9a14677ff | |||
| 72b845d964 | |||
| 22319e3a05 | |||
| 9ff664c6c9 | |||
| 394f625bb6 | |||
| 42471eb9ff | |||
| 04bf81902c | |||
| 5dbe09f08d | |||
| 652059025f | |||
| 2ff7bc63ff | |||
| 8f60ab8910 | |||
| 401fdfb10a | |||
| 9720944471 | |||
| b04cd7ece0 | |||
| 650006c6eb | |||
| 99df1a3f6d | |||
| 3ab375f324 | |||
| 39d85804ae | |||
| 4eefcd33ca | |||
| 56d092c8b3 | |||
| e2e31ca870 | |||
| 0bced941e8 | |||
| 3e75a0f266 | |||
| 365bebd9d6 | |||
| e7f6f8a91a | |||
| 05480f2a7d | |||
| 31f21c3443 | |||
| 4f5a161ff1 | |||
| e15d361870 | |||
| 9baec518af | |||
| 66b5047e43 | |||
| dae8e21ce2 | |||
| 0045eaa7a1 | |||
| 450ca8c2a5 | |||
| d6726b3526 | |||
| a2ea2dd0f1 | |||
| bd659cc69e | |||
| 43261b75b0 | |||
| 745e12c13f | |||
| 5244cbf81d | |||
| 6778676cba | |||
| 24be3e65e6 | |||
| 9abe73fe0b | |||
| b45b323e05 | |||
| 963c6a6d1b | |||
| 2254f031f7 | |||
| d85f62f7d4 | |||
| 604e8e9cf4 | |||
| 482acf1aaf | |||
| 9f4a8ea54e | |||
| 6831c7566c | |||
| 599ec30da7 | |||
| 174f89633e |
@@ -150,7 +150,7 @@ jobs:
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
-
|
||||
name: Configure AWS Credentials
|
||||
uses: aws-actions/configure-aws-credentials@ec61189d14ec14c8efccab744f656cffd0e33f37 # v6.1.0
|
||||
uses: aws-actions/configure-aws-credentials@acca2b1b2070338fb9fd1ca27ecee81d687e58e5 # v6.1.2
|
||||
with:
|
||||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||
@@ -198,7 +198,7 @@ jobs:
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
-
|
||||
name: Configure AWS Credentials
|
||||
uses: aws-actions/configure-aws-credentials@ec61189d14ec14c8efccab744f656cffd0e33f37 # v6.1.0
|
||||
uses: aws-actions/configure-aws-credentials@acca2b1b2070338fb9fd1ca27ecee81d687e58e5 # v6.1.2
|
||||
with:
|
||||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||
|
||||
@@ -35,12 +35,12 @@ jobs:
|
||||
node-version: ${{ env.NODE_VERSION }}
|
||||
-
|
||||
name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4.35.2
|
||||
uses: github/codeql-action/init@7211b7c8077ea37d8641b6271f6a365a22a5fbfa # v4.36.0
|
||||
with:
|
||||
languages: javascript-typescript
|
||||
build-mode: none
|
||||
-
|
||||
name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4.35.2
|
||||
uses: github/codeql-action/analyze@7211b7c8077ea37d8641b6271f6a365a22a5fbfa # v4.36.0
|
||||
with:
|
||||
category: "/language:javascript-typescript"
|
||||
|
||||
@@ -11,7 +11,7 @@ on:
|
||||
|
||||
jobs:
|
||||
run:
|
||||
uses: crazy-max/.github/.github/workflows/pr-assign-author.yml@4a17dbaa9ce13920fc5bb8824eb89c16301e5ab2 # v1.7.0
|
||||
uses: crazy-max/.github/.github/workflows/pr-assign-author.yml@9ba6e6f9450baf3b1237f8035c1fdc45932510bd # v1.8.0
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: write
|
||||
|
||||
@@ -23,13 +23,13 @@ jobs:
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
-
|
||||
name: Test
|
||||
uses: docker/bake-action@a66e1c87e2eca0503c343edf1d208c716d54b8a8 # v7.1.0
|
||||
uses: docker/bake-action@6614cfa25eff9a0b2b2697efb0b6159e7680d584 # v7.2.0
|
||||
with:
|
||||
source: .
|
||||
targets: test
|
||||
-
|
||||
name: Upload coverage
|
||||
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0
|
||||
uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1
|
||||
with:
|
||||
files: ./coverage/clover.xml
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
|
||||
@@ -21,11 +21,13 @@ jobs:
|
||||
-
|
||||
name: GitHub auth token from GitHub App
|
||||
id: docker-read-app
|
||||
uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1
|
||||
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
|
||||
with:
|
||||
app-id: ${{ secrets.GHACTIONS_REPO_WRITE_APP_ID }}
|
||||
private-key: ${{ secrets.GHACTIONS_REPO_WRITE_APP_PRIVATE_KEY }}
|
||||
owner: docker
|
||||
repositories: login-action
|
||||
permission-contents: write
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
@@ -35,7 +37,7 @@ jobs:
|
||||
token: ${{ steps.docker-read-app.outputs.token }}
|
||||
-
|
||||
name: Build
|
||||
uses: docker/bake-action@a66e1c87e2eca0503c343edf1d208c716d54b8a8 # v7.1.0
|
||||
uses: docker/bake-action@6614cfa25eff9a0b2b2697efb0b6159e7680d584 # v7.2.0
|
||||
with:
|
||||
source: .
|
||||
targets: build
|
||||
|
||||
@@ -26,7 +26,7 @@ jobs:
|
||||
-
|
||||
name: Generate matrix
|
||||
id: generate
|
||||
uses: docker/bake-action/subaction/matrix@a66e1c87e2eca0503c343edf1d208c716d54b8a8 # v7.1.0
|
||||
uses: docker/bake-action/subaction/matrix@6614cfa25eff9a0b2b2697efb0b6159e7680d584 # v7.2.0
|
||||
with:
|
||||
target: validate
|
||||
|
||||
@@ -41,6 +41,6 @@ jobs:
|
||||
steps:
|
||||
-
|
||||
name: Validate
|
||||
uses: docker/bake-action@a66e1c87e2eca0503c343edf1d208c716d54b8a8 # v7.1.0
|
||||
uses: docker/bake-action@6614cfa25eff9a0b2b2697efb0b6159e7680d584 # v7.2.0
|
||||
with:
|
||||
targets: ${{ matrix.target }}
|
||||
|
||||
@@ -19,7 +19,7 @@ on:
|
||||
|
||||
jobs:
|
||||
zizmor:
|
||||
uses: crazy-max/.github/.github/workflows/zizmor.yml@4a17dbaa9ce13920fc5bb8824eb89c16301e5ab2 # v1.7.0
|
||||
uses: crazy-max/.github/.github/workflows/zizmor.yml@9ba6e6f9450baf3b1237f8035c1fdc45932510bd # v1.8.0
|
||||
permissions:
|
||||
contents: read
|
||||
security-events: write
|
||||
|
||||
+8
-4
@@ -1,10 +1,10 @@
|
||||
# https://yarnpkg.com/configuration/yarnrc
|
||||
|
||||
compressionLevel: mixed
|
||||
enableGlobalCache: false
|
||||
enableHardenedMode: true
|
||||
nodeLinker: node-modules
|
||||
|
||||
logFilters:
|
||||
- code: YN0004
|
||||
level: discard
|
||||
- code: YN0013
|
||||
level: discard
|
||||
- code: YN0019
|
||||
@@ -14,4 +14,8 @@ logFilters:
|
||||
- code: YN0086
|
||||
level: discard
|
||||
|
||||
nodeLinker: node-modules
|
||||
compressionLevel: mixed
|
||||
enableGlobalCache: false
|
||||
enableHardenedMode: true
|
||||
enableScripts: false
|
||||
npmMinimalAgeGate: 2d
|
||||
|
||||
@@ -117,6 +117,8 @@ instead of a password.
|
||||
|
||||
### Azure Container Registry (ACR)
|
||||
|
||||
#### Service principal
|
||||
|
||||
[Create a service principal](https://docs.microsoft.com/en-us/azure/container-registry/container-registry-auth-service-principal#create-a-service-principal)
|
||||
with access to your container registry through the [Azure CLI](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli)
|
||||
and take note of the generated service principal's ID (also called _client ID_)
|
||||
@@ -142,10 +144,60 @@ jobs:
|
||||
password: ${{ secrets.AZURE_CLIENT_SECRET }}
|
||||
```
|
||||
|
||||
> [!NOTE]
|
||||
> Replace `<registry-name>` with the name of your registry.
|
||||
|
||||
#### OpenID Connect (OIDC)
|
||||
|
||||
To authenticate with OpenID Connect, configure a federated identity credential
|
||||
for GitHub Actions and use the [Azure Login](https://github.com/Azure/login)
|
||||
action to sign in to Azure. Then expose an ACR access token and pass it to this
|
||||
action as the password.
|
||||
|
||||
```yaml
|
||||
name: ci
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: main
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
id-token: write
|
||||
|
||||
jobs:
|
||||
login:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
name: Login to Azure
|
||||
uses: azure/login@v3
|
||||
with:
|
||||
client-id: ${{ vars.AZURE_CLIENT_ID }}
|
||||
tenant-id: ${{ vars.AZURE_TENANT_ID }}
|
||||
subscription-id: ${{ vars.AZURE_SUBSCRIPTION_ID }}
|
||||
-
|
||||
name: Get ACR access token
|
||||
id: acr-token
|
||||
run: |
|
||||
ACR_TOKEN=$(az acr login --name <registry-name> --expose-token --output tsv --query accessToken)
|
||||
echo "::add-mask::$ACR_TOKEN" # mask the token in workflow logs
|
||||
echo "token=$ACR_TOKEN" >> "$GITHUB_OUTPUT"
|
||||
-
|
||||
name: Login to ACR
|
||||
uses: docker/login-action@v4
|
||||
with:
|
||||
registry: <registry-name>.azurecr.io
|
||||
username: 00000000-0000-0000-0000-000000000000
|
||||
password: ${{ steps.acr-token.outputs.token }}
|
||||
```
|
||||
|
||||
> [!NOTE]
|
||||
> Replace `<registry-name>` with the name of your registry.
|
||||
|
||||
### Google Container Registry (GCR)
|
||||
|
||||
> [!NOTE]
|
||||
> [Google Artifact Registry](#google-artifact-registry-gar) is the evolution of
|
||||
> Google Container Registry. As a fully-managed service with support for both
|
||||
> container images and non-container artifacts. If you currently use Google
|
||||
@@ -176,7 +228,7 @@ jobs:
|
||||
-
|
||||
name: Authenticate to Google Cloud
|
||||
id: auth
|
||||
uses: google-github-actions/auth@v1
|
||||
uses: google-github-actions/auth@v3
|
||||
with:
|
||||
token_format: access_token
|
||||
workload_identity_provider: <workload_identity_provider>
|
||||
@@ -190,9 +242,10 @@ jobs:
|
||||
password: ${{ steps.auth.outputs.access_token }}
|
||||
```
|
||||
|
||||
> [!NOTE]
|
||||
> Replace `<workload_identity_provider>` with configured workload identity
|
||||
> provider. For steps to configure, [see here](https://github.com/google-github-actions/auth#setting-up-workload-identity-federation).
|
||||
|
||||
>
|
||||
> Replace `<service_account>` with configured service account in workload
|
||||
> identity provider which has access to push to GCR
|
||||
|
||||
@@ -247,7 +300,7 @@ jobs:
|
||||
-
|
||||
name: Authenticate to Google Cloud
|
||||
id: auth
|
||||
uses: google-github-actions/auth@v1
|
||||
uses: google-github-actions/auth@v3
|
||||
with:
|
||||
token_format: access_token
|
||||
workload_identity_provider: <workload_identity_provider>
|
||||
@@ -261,12 +314,13 @@ jobs:
|
||||
password: ${{ steps.auth.outputs.access_token }}
|
||||
```
|
||||
|
||||
> [!NOTE]
|
||||
> Replace `<workload_identity_provider>` with configured workload identity
|
||||
> provider
|
||||
|
||||
>
|
||||
> Replace `<service_account>` with configured service account in workload
|
||||
> identity provider which has access to push to GCR
|
||||
|
||||
>
|
||||
> Replace `<location>` with the regional or multi-regional [location](https://cloud.google.com/artifact-registry/docs/repo-organize#locations)
|
||||
> of the repository where the image is stored.
|
||||
|
||||
@@ -298,6 +352,7 @@ jobs:
|
||||
password: ${{ secrets.GAR_JSON_KEY }}
|
||||
```
|
||||
|
||||
> [!NOTE]
|
||||
> Replace `<location>` with the regional or multi-regional [location](https://cloud.google.com/artifact-registry/docs/repo-organize#locations)
|
||||
> of the repository where the image is stored.
|
||||
|
||||
@@ -352,6 +407,7 @@ jobs:
|
||||
AWS_ACCOUNT_IDS: 012345678910,023456789012
|
||||
```
|
||||
|
||||
> [!NOTE]
|
||||
> Only available with [AWS CLI version 1](https://docs.aws.amazon.com/cli/latest/reference/ecr/get-login.html)
|
||||
|
||||
You can also use the [Configure AWS Credentials](https://github.com/aws-actions/configure-aws-credentials)
|
||||
@@ -370,7 +426,7 @@ jobs:
|
||||
steps:
|
||||
-
|
||||
name: Configure AWS Credentials
|
||||
uses: aws-actions/configure-aws-credentials@v4
|
||||
uses: aws-actions/configure-aws-credentials@v6
|
||||
with:
|
||||
aws-access-key-id: ${{ vars.AWS_ACCESS_KEY_ID }}
|
||||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||
@@ -382,6 +438,7 @@ jobs:
|
||||
registry: <aws-account-number>.dkr.ecr.<region>.amazonaws.com
|
||||
```
|
||||
|
||||
> [!NOTE]
|
||||
> Replace `<aws-account-number>` and `<region>` with their respective values.
|
||||
|
||||
### AWS Public Elastic Container Registry (ECR)
|
||||
@@ -413,6 +470,7 @@ jobs:
|
||||
AWS_REGION: <region>
|
||||
```
|
||||
|
||||
> [!NOTE]
|
||||
> Replace `<region>` with its respective value (default `us-east-1`).
|
||||
|
||||
### OCI Oracle Cloud Infrastructure Registry (OCIR)
|
||||
@@ -445,6 +503,7 @@ jobs:
|
||||
password: ${{ secrets.OCI_TOKEN }}
|
||||
```
|
||||
|
||||
> [!NOTE]
|
||||
> Replace `<region>` with their respective values from [availability regions](https://docs.cloud.oracle.com/iaas/Content/Registry/Concepts/registryprerequisites.htm#Availab)
|
||||
|
||||
### Quay.io
|
||||
@@ -603,7 +662,7 @@ jobs:
|
||||
scope: 'myorg/myimage@push'
|
||||
-
|
||||
name: Build and push
|
||||
uses: docker/build-push-action@v6
|
||||
uses: docker/build-push-action@v7
|
||||
with:
|
||||
push: true
|
||||
tags: myorg/myimage:latest
|
||||
|
||||
+160
-138
File diff suppressed because one or more lines are too long
+4
-4
File diff suppressed because one or more lines are too long
+326
-499
File diff suppressed because it is too large
Load Diff
+5
-5
@@ -21,12 +21,12 @@
|
||||
],
|
||||
"author": "Docker Inc.",
|
||||
"license": "Apache-2.0",
|
||||
"packageManager": "yarn@4.9.2",
|
||||
"packageManager": "yarn@4.15.0",
|
||||
"dependencies": {
|
||||
"@actions/core": "^3.0.0",
|
||||
"@aws-sdk/client-ecr": "^3.1020.0",
|
||||
"@aws-sdk/client-ecr-public": "^3.1020.0",
|
||||
"@docker/actions-toolkit": "^0.86.0",
|
||||
"@actions/core": "^3.0.1",
|
||||
"@aws-sdk/client-ecr": "^3.1050.0",
|
||||
"@aws-sdk/client-ecr-public": "^3.1050.0",
|
||||
"@docker/actions-toolkit": "^0.91.0",
|
||||
"http-proxy-agent": "^9.0.0",
|
||||
"https-proxy-agent": "^9.0.0",
|
||||
"js-yaml": "^4.1.1"
|
||||
|
||||
Reference in New Issue
Block a user