GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - docker/oidc-action: Official OIDC action for authenticating with Docker

BranchesTags
Open more actions menu

Latest commit

 

History

31 Commits
31 Commits

Folders and files

NameName
Last commit message
Last commit date
.devcontainer
.devcontainer
 
 
.github
.github
 
 
.licenses/npm
.licenses/npm
 
 
.vscode
.vscode
 
 
__fixtures__
__fixtures__
 
 
__tests__
__tests__
 
 
badges
badges
 
 
dist
dist
 
 
script
script
 
 
src
src
 
 
.env.example
.env.example
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
.licensed.yaml
.licensed.yaml
 
 
.markdown-lint.yaml
.markdown-lint.yaml
 
 
.node-version
.node-version
 
 
.npmrc
.npmrc
 
 
.poutine.yaml
.poutine.yaml
 
 
.prettierignore
.prettierignore
 
 
.prettierrc.yaml
.prettierrc.yaml
 
 
.trivyignore
.trivyignore
 
 
.yaml-lint.yaml
.yaml-lint.yaml
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
SECURITY.md
SECURITY.md
 
 
action.yaml
action.yaml
 
 
eslint.config.mjs
eslint.config.mjs
 
 
jest.config.js
jest.config.js
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 
rollup.config.ts
rollup.config.ts
 
 
tsconfig.base.json
tsconfig.base.json
 
 
tsconfig.eslint.json
tsconfig.eslint.json
 
 
tsconfig.json
tsconfig.json
 
 

Repository files navigation

Docker OIDC Action

GitHub Super-Linter CI Check dist/ CodeQL Coverage

The official GitHub Action for authenticating to Docker with OIDC.

It exchanges the GitHub-issued OIDC token for your workflow for a short-lived Docker access token — so you can log in to Docker Hub without storing a long-lived password or personal access token as a secret.

Note: The returned token's scope is currently limited to registry login (for example, with docker/login-action). Broader use, such as authenticating to the Docker Hub API, is not supported yet.

Prerequisites

Create an OIDC connection in your Docker organization and note its connection ID. Follow the steps in the Docker documentation.

Usage

The action requires id-token: write permission so the workflow can request a GitHub OIDC token. The exchanged Docker token is returned as the token output and is masked in workflow logs by default.

jobs:
  build:
    runs-on: ubuntu-latest
    permissions:
      id-token: write # required to request the GitHub OIDC token
    steps:
      - name: Get Docker token
        id: docker_oidc
        uses: docker/oidc-action@v1
        with:
          connection-id: <my-connection-id>

      - name: Log in to Docker Hub
        uses: docker/login-action@v4
        with:
          username: <my-org-name>
          password: ${{ steps.docker_oidc.outputs.token }}

Passing a token between jobs

GitHub skips job outputs containing masked secrets. To pass the token to another job or reusable workflow, set mask-token: 'false' in the producing job, see the example below:

jobs:
  docker-token:
    runs-on: ubuntu-latest
    permissions:
      id-token: write
    outputs:
      token: ${{ steps.oidc.outputs.token }}
    steps:
      - name: Get Docker token
        id: oidc
        uses: docker/oidc-action@v1
        with:
          connection-id: ${{ vars.DOCKERHUB_OIDC_CONNECTIONID }}
          mask-token: 'false'

  publish:
    needs: docker-token
    uses: ./.github/workflows/publish.yaml
    secrets:
      registry-password: ${{ needs.docker-token.outputs.token }}

Disabling masking removes automatic log redaction of the Docker token in the producing job. Avoid printing it and mask it in any receiving job before use.

When you control the consuming job, prefer requesting a fresh token there and keep masking enabled.

Inputs

Input Required Default Description
connection-id Yes — The OIDC connection ID from your Docker organization. Must be a v4 UUID.
expires-in No 300 Lifetime of the returned token, in seconds. Must be between 300 (5 min) and 21600 (6 hours).
mask-token No true Mask the returned Docker token in workflow logs. Set to false to allow forwarding it as a job output.

Outputs

Output Description
token The short-lived Docker access token. Use it as the password for registry login.

License

Distributed under the terms of the Apache 2.0 License.

About

Official OIDC action for authenticating with Docker

Resources

Readme
Apache-2.0 license

Security policy

Security policy
Activity
Custom properties

Stars

3 stars

Watchers

0 watching

Forks

3 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

Generated from actions/typescript-action
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.