Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/bake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -768,6 +768,7 @@ jobs:
registry-auth: |
- registry: ${{ needs.registry-identities.outputs.dockerhub-oidc-registry }}
username: ${{ needs.registry-identities.outputs.dockerhub-oidc-username }}
scope: ${{ needs.registry-identities.outputs.dockerhub-oidc-scope }}
-
name: Authenticate to Azure
if: ${{ needs.registry-identities.outputs.azure-acr-enabled == 'true' }}
Expand Down Expand Up @@ -1243,6 +1244,7 @@ jobs:
registry-auth: |
- registry: ${{ needs.registry-identities.outputs.dockerhub-oidc-registry }}
username: ${{ needs.registry-identities.outputs.dockerhub-oidc-username }}
scope: ${{ needs.registry-identities.outputs.dockerhub-oidc-scope }}
-
name: Authenticate to Azure
if: ${{ inputs.push && inputs.output == 'image' && needs.registry-identities.outputs.azure-acr-enabled == 'true' }}
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,7 @@ jobs:
registry-auth: |
- registry: ${{ needs.registry-identities.outputs.dockerhub-oidc-registry }}
username: ${{ needs.registry-identities.outputs.dockerhub-oidc-username }}
scope: ${{ needs.registry-identities.outputs.dockerhub-oidc-scope }}
-
name: Authenticate to Azure
if: ${{ needs.registry-identities.outputs.azure-acr-enabled == 'true' }}
Expand Down Expand Up @@ -1128,6 +1129,7 @@ jobs:
registry-auth: |
- registry: ${{ needs.registry-identities.outputs.dockerhub-oidc-registry }}
username: ${{ needs.registry-identities.outputs.dockerhub-oidc-username }}
scope: ${{ needs.registry-identities.outputs.dockerhub-oidc-scope }}
-
name: Authenticate to Azure
if: ${{ inputs.push && inputs.output == 'image' && needs.registry-identities.outputs.azure-acr-enabled == 'true' }}
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/setup-registry-identities.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ on:
dockerhub-oidc-connection-id:
description: "Docker Hub OIDC connection ID"
value: ${{ jobs.setup-registry-identities.outputs.dockerhub-oidc-connection-id }}
dockerhub-oidc-scope:
description: "Docker Hub authentication scope"
value: ${{ jobs.setup-registry-identities.outputs.dockerhub-oidc-scope }}
azure-acr-enabled:
description: "Whether an Azure ACR registry identity was configured"
value: ${{ jobs.setup-registry-identities.outputs.azure-acr-enabled }}
Expand Down Expand Up @@ -114,6 +117,7 @@ jobs:
dockerhub-oidc-registry: ${{ steps.validate.outputs.dockerhub-oidc-registry }}
dockerhub-oidc-username: ${{ steps.validate.outputs.dockerhub-oidc-username }}
dockerhub-oidc-connection-id: ${{ steps.validate.outputs.dockerhub-oidc-connection-id }}
dockerhub-oidc-scope: ${{ steps.validate.outputs.dockerhub-oidc-scope }}
azure-acr-enabled: ${{ steps.validate.outputs.azure-acr-enabled }}
azure-acr-registry: ${{ steps.validate.outputs.azure-acr-registry }}
azure-acr-client-id: ${{ steps.validate.outputs.azure-acr-client-id }}
Expand Down Expand Up @@ -186,6 +190,7 @@ jobs:
core.setOutput('dockerhub-oidc-registry', '');
core.setOutput('dockerhub-oidc-username', '');
core.setOutput('dockerhub-oidc-connection-id', '');
core.setOutput('dockerhub-oidc-scope', '');
core.setOutput('azure-acr-enabled', 'false');
core.setOutput('azure-acr-registry', '');
core.setOutput('azure-acr-client-id', '');
Expand Down Expand Up @@ -245,6 +250,7 @@ jobs:
core.setOutput('dockerhub-oidc-registry', dockerhubOidc?.registry || '');
core.setOutput('dockerhub-oidc-username', dockerhubOidc?.username || '');
core.setOutput('dockerhub-oidc-connection-id', dockerhubOidc?.connectionID || '');
core.setOutput('dockerhub-oidc-scope', dockerhubOidc?.scope || '');
core.setOutput('azure-acr-enabled', azureAcr ? 'true' : 'false');
core.setOutput('azure-acr-registry', azureAcr?.registry || '');
core.setOutput('azure-acr-client-id', azureAcr?.clientId || '');
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ jobs:
registry-auth: |
- registry: ${{ needs.registry-identities.outputs.dockerhub-oidc-registry }}
username: ${{ needs.registry-identities.outputs.dockerhub-oidc-username }}
scope: ${{ needs.registry-identities.outputs.dockerhub-oidc-scope }}
-
name: Authenticate to Azure
if: ${{ steps.vars.outputs.signed == 'true' && steps.vars.outputs.output-type == 'image' && needs.registry-identities.outputs.azure-acr-enabled == 'true' }}
Expand Down
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -538,12 +538,13 @@ jobs:
connection_id: 123e4567-e89b-42d3-a456-426614174000
```

| Name | Type | Required | Description |
|-----------------|--------|----------|-----------------------------------------------------------------------------|
| `type` | String | Yes | Registry identity provider type. Must be `dockerhub`. |
| `registry` | String | No | Registry hostname passed to `docker/login-action`. Defaults to `docker.io`. |
| `username` | String | Yes | Docker Hub username or organization passed to `docker/login-action`. |
| `connection_id` | String | Yes | Docker Hub OIDC connection ID passed to `docker/login-action` in each job. |
| Name | Type | Required | Description |
|-----------------|--------|----------|-----------------------------------------------------------------------------------------------------------------------------------|
| `type` | String | Yes | Registry identity provider type. Must be `dockerhub`. |
| `registry` | String | No | Registry hostname passed to `docker/login-action`. Defaults to `docker.io`. |
| `username` | String | Yes | Docker Hub username or organization passed to `docker/login-action`. |
| `connection_id` | String | Yes | Docker Hub OIDC connection ID passed to `docker/login-action` in each job. |
| `scope` | String | No | [Authentication scope](https://github.com/docker/login-action#set-scopes-for-the-authentication-token) for `docker/login-action`. |

The workflow mints the Docker Hub access token inside each reusable workflow
job that needs Docker Hub registry access. The token is not accepted as an
Expand Down
Loading