百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
A

actions--access-token

> DevOps
开源

摒弃个人访问令牌 (PAT) 和凭证管理, 使用临时 GitHub 应用程序访问令牌!

199 stars0 点赞2 次浏览
访问官网GitHub

工具介绍

摒弃个人访问令牌 (PAT) 和凭证管理, 使用临时 GitHub 应用程序访问令牌!

  GitHub Actions Access Tokens

 

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.

Concept

  1. This GitHub action will request an access token for a Target Repository from the App Server, authorize by the GitHub Action OIDC Token.
  2. The App Server requests a GitHub App Installation Token to read .github/access-token.yaml file in Target Repository.
  3. The App Server reads .github/access-token.yaml file from Target Repository and determine which permissions should be granted to Requesting GitHub Action Identity.
  4. The App Server requests a GitHub App Installation Token with granted permissions for Requesting GitHub Action Identity and send it back in response to this GitHub action from step 1..
  5. This GitHub action sets the token as the step output field token
  6. Further job steps can then utilize this token to access resources of the Granting Repository e.g. ${{ steps..outputs.token }}.

Usage

See Action Metadata and Example Use Cases.

Prerequisites

1. Install Access Manager App to Target Repositories

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 write assess to .github/access-token.yaml can grant repository access permissions to GitHub Actions workflow runs.

[!TIP] For organizations on GitHub Team or Enterprise plan it is possible to restrict write access to .github/access-token.yaml to repository admins only by using a push ruleset Protect access token policy ruleset

  • Create a new push ruleset
  • Set Ruleset Name to Protect access token policy
  • Set Enforcement status to Active
  • Hit Add bypass, select Repository admin and hit Add selected
  • Set Target repositories to All repositories
  • Enable Restrict file paths
    • Click Add file path, set File path to .github/access-token.yaml and hit Add file path
      • Also add file path .github/access-token.yml
  • Hit Create button

2. Create and Configure Owner Policy

Create a OWNER/.github-access-token repository and create an owner access-token.yaml policy file at the root directory of the repository.

Grant Permissions to Workflow Run

Grant Repository Permissions

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

Grant Owner Permissions

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

Example Use Cases

Update Secrets

Click me

…

Clone an Internal or Private Repository

Click me

yaml
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 }}

Trigger a Workflow

Click me

yaml
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}}
    # ...

Configure Custom App Server Endpoint

Click me

…

Development

Action Release Workflow

  • Run actions-release workflow to create a new action release

Resources

  • App icon: https://img.icons8.com/cotton/256/000000/grand-master-key.png

Issues· 4 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

TypeScriptaccessactionalternativci

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类DevOps
定价开源

> 相关工具

D
Docker
容器化平台,标准化应用交付
G
GitHub Actions
GitHub 原生 CI/CD 工作流
N
Nginx
高性能 Web 服务器与反向代理