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

get-secretmanager-secrets

> 数据库
开源

GitHub 操作用于 Google 秘密管理器,从中访问秘密信息,并将其作为输出提供。

197 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

GitHub 操作用于 Google 秘密管理器,从中访问秘密信息,并将其作为输出提供。

get-secretmanager-secrets

This action fetches secrets from Secret Manager and makes them available to later build steps via outputs. This is useful when you want Secret Manager to be the source of truth for secrets in your organization, but you need access to those secrets in build steps.

Secrets that are successfully fetched are set as output variables and can be used in subsequent actions. After a secret is accessed, its value is added to the mask of the build to reduce the chance of it being printed or logged by later steps.

This is not an officially supported Google product, and it is not covered by a Google Cloud support contract. To report bugs or request features in a Google Cloud product, please contact Google Cloud support.

Prerequisites

  • This action requires Google Cloud credentials that are authorized to access the secrets being requested. See Authorization for more information.

  • This action runs using Node 20. If you are using self-hosted GitHub Actions runners, you must use a runner version that supports this version or newer.

Usage

…

Inputs

  • secrets: (Required) List of secrets to access and inject into the environment. These are comma-separated or newline-separated OUTPUTNAME:SECRET. Output names or secret names that contain separators must be escaped with a backslash (e.g. \, or \\n) unless quoted. Any leading or trailing whitespace is trimmed unless values are quoted.

    yaml
    secrets: |-
      output1:my-project/my-secret1
      output2:my-project/my-secret2

    Secrets can be referenced using the following formats:

    # Long form
    projects//secrets//versions/
    
    # Long form - "latest" version
    projects//secrets/
    
    # Short form
    //
    
    # Short form - "latest" version
    /
  • min_mask_length: (Optional, default: 4) Minimum line length for a secret to be masked. Extremely short secrets (e.g. { or a) can make GitHub Actions log output unreadable. This is especially important for multi-line secrets, since each line of the secret is masked independently.

  • export_to_environment: (Optional) Make the fetched secrets additionally available as environment variables.

  • encoding: (Optional, default: utf8) Encoding in which secrets will be exported into outputs (and environment variables if export_to_environment is true). For secrets that cannot be represented in text, such as encryption key bytes, choose an encoding that has a safe character such as base64 or hex. For more information about available encoding types, please see the Node.js Buffer and character encodings.

  • universe: (Optional, default: googleapis.com) The Google Cloud universe to use for constructing API endpoints. The default universe is "googleapis.com", which corresponds to https://cloud.google.com. Trusted Partner Cloud and Google Distributed Hosted Cloud should set this to their universe address.

Outputs

  • secrets: Each secret is prefixed with an output name. The secret's resolved access value will be available at that output in future build steps. For example:

    yaml
    jobs:
      job_id:
        steps:
        - id: 'secrets'
          uses: 'google-github-actions/get-secretmanager-secrets@v3'
          with:
            secrets: |-
              token:my-project/docker-registry-token

    will be available in future steps as the output:

    steps.secrets.outputs.token

Authorization

There are a few ways to authenticate this action. The caller must have permissions to access the secrets being requested.

Via google-github-actions/auth

Use google-github-actions/auth to authenticate the action. You can use Workload Identity Federation or traditional Service Account Key JSON authentication.

yaml
jobs:
  job_id:
    permissions:
      contents: 'read'
      id-token: 'write'

    steps:
    - uses: 'actions/checkout@v4'

    - id: 'auth'
      uses: 'google-github-actions/auth@v3'
      with:
        workload_identity_provider: 'projects/123456789/locations/global/workloadIdentityPools/my-pool/providers/my-provider'
        service_account: '[email protected]'

    - id: 'secrets'
      uses: 'google-github-actions/get-secretmanager-secrets@v3'

Via Application Default Credentials

If you are hosting your own runners, and those runners are on Google Cloud, you can leverage the Application Default Credentials of the instance. This will authenticate requests as the service account attached to the instance. This only works using a custom runner hosted on GCP.

yaml
jobs:
  job_id:
    steps:
    - id: 'secrets'
      uses: 'google-github-actions/get-secretmanager-secrets@v3'

The action will automatically detect and use the Application Default Credentials.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

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

> 标签

TypeScriptactionsgcpgithub-actionsgoogle-cloud

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

> 工具信息

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

> 相关工具

P
PostgreSQL
功能强大的开源关系型数据库
R
Redis
内存数据结构存储,常用作缓存与队列
M
MySQL
广泛使用的开源关系型数据库