Machine Identity
GitHub ActionsEnterprise
Calling Multi-Router from a GitHub Actions workflow with its OIDC token.
A GitHub Actions workflow authenticates to Multi-Router with the OpenID Connect token GitHub issues to each run. GitHub is the issuer, and the subject names the repository and what triggered the run, such as a branch or an environment. The workflow's only credential is that token.
Registering GitHub Actions
Register https://token.actions.githubusercontent.com as an issuer, authorize the organization that owns the routers, and copy the token audience. See Issuers.
Binding the repository
Add a binding with Caller type CI job, and one of these subjects:
| Subject | Match | Covers |
|---|---|---|
repo:example-co/billing:ref:refs/heads/main | This exact subject | Runs on the main branch. |
repo:example-co/billing:environment:production | This exact subject | Jobs in the production environment. |
repo:example-co/billing | Anything under a prefix | Every run of the repository. |
Prefixes on GitHub Actions name a complete owner and repository, because GitHub issues tokens for every repository on GitHub. See Bindings.
The workflow
The workflow requests the id-token: write permission, fetches a token for the issuer's audience, and sends it as a bearer token:
GitHub's tokens last a few minutes, within the issuer's maximum token lifetime. A long job fetches a new token before the old one expires.