Get rid of personal access tokens (PAT) and credential management, use temporary GitHub Application access tokens instead!
Get rid of personal access tokens (PAT) and credential management, use temporary GitHub Application access tokens instead!
Obtain temporary Access Tokens for GitHub Actions workflows by requesting GitHub App Installation Access Tokens.
Authorization is based on the GitHub Actions OIDC tokens and .github/access-token.yaml file in the target repositories.
.github/access-token.yaml file in Target Repository..github/access-token.yaml file from Target Repository and determine which permissions should be granted to Requesting GitHub Action Identity.1..token${{ steps..outputs.token }}.See Action Metadata and Example Use Cases.
Install Access Tokens for GitHub Actions from Marketplace or host and install your own GitHub App
[!WARNING] Be aware by installing the access token GitHub App everybody with
writeassess to.github/access-token.yamlcan grant repository access permissions to GitHub Actions workflow runs.
[!TIP] For organizations on GitHub Team or Enterprise plan it is possible to restrict
writeaccess to.github/access-token.yamlto repository admins only by using a push ruleset Protect access token policy ruleset
Ruleset Name to Protect access token policyEnforcement status to ActiveAdd bypass, select Repository admin and hit Add selectedTarget repositories to All repositoriesRestrict file pathsAdd file path, set File path to .github/access-token.yaml and hit Add file path.github/access-token.ymlCreate buttonCreate a OWNER/.github-access-token repository and create an owner access-token.yaml policy file at the root directory of the repository.
To grant repository permission create an repository access-token.yaml policy file within the .github/ directory of the target repository.
[!IMPORTANT] Ensure repository permissions have been granted (
allowed-repository-permissions) within the owner access policy file see Create and Configure Owner Policy
[!Note] You can also grant repository permissions to all organization repositories within the owner access policy file see Create and Configure Owner Policy
To grant owner specific or owner wide permission create a OWNER/.github-access-token repository and create an access-token.yaml file at root of the repository with this template content
Click me
…Click me
name: GitHub Actions Access Manager Example
on:
workflow_dispatch:
push:
branches:
- main
jobs:
checkout:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: qoomon/actions--access-token@v4
id: access-token
with:
repositories: target-repository
permissions: |
contents: read
- uses: actions/checkout@v4
with:
repository: [target repository]
token: ${{ steps.access-token.outputs.token }}Click me
on:
workflow_dispatch:
push:
branches:
- main
permissions:
id-token: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: qoomon/actions--access-token@v4
id: access-token
with:
permissions: |
actions: write
- name: Trigger workflow
run: >-
gh workflow
run [target workflow].yml
--field logLevel=debug
env:
GITHUB_TOKEN: ${{steps.access-token.outputs.token}}
# ...Click me
…No open issues yet, or sync has not completed.