MIT License

项目介绍

1Password/load-secrets-action 是一个托管在 GitHub 上的开源项目,主要使用 TypeScript 编写,采用 MIT License 许可证,目前获得 357 个 Star、49 次 Fork。

仓库全名
1Password/load-secrets-action
开源许可证
MIT License
Star 数
357
Fork 数
49
未关闭 Issue
16

README 摘要

Load Secrets from 1Password - GitHub Action Provide the secrets your GitHub runner needs from 1Password. load-secrets-action loads secrets from 1Password into GitHub Actions using Service Accounts, 1Password Connect, or Workload Identity. Specify in your workflow YAML file which secrets from 1Password should be loaded into your job, and the action will make them available as environment variables for the next steps…

完整内容见 GitHub 原始 README 或本页 。

常见问题

load-secrets-action 用什么语言开发?

主要使用 TypeScript 编写,采用 MIT License 许可证,目前有 357 个 Star。

load-secrets-action 可以免费商用吗?

仓库采用 MIT License 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 load-secrets-action 的源码?

可以直接克隆仓库:git clone https://github.com/1Password/load-secrets-action.git,默认分支为 main;安装与运行步骤见仓库 README。

load-secrets-action 最近还在维护吗?

仓库最近一次更新为 3 天前,当前有 16 个未关闭 Issue;Star 数为 357,可作为社区活跃度的参考。

关于

Load secrets from 1Password into your GitHub Actions jobs

描述取自 GitHub 官方 API,中文内容由 GitRead 中文社区 编辑团队整理。

简要分析

热度分
466
价值分
229
活跃状态
活跃

README

Load Secrets from 1Password - GitHub Action

Provide the secrets your GitHub runner needs from 1Password.

Get started

load-secrets-action loads secrets from 1Password into GitHub Actions using Service Accounts, 1Password Connect, or Workload Identity.

Specify in your workflow YAML file which secrets from 1Password should be loaded into your job, and the action will make them available as environment variables for the next steps.

Read more on the 1Password Developer Portal.

This project is licensed under MIT. Use of the 1Password APIs and services accessed through these tools is governed by the 1Password API Terms of Service.

🪄 See it in action!

Using 1Password Service Accounts with GitHub Actions - showcase

✨ Quickstart

on: push
jobs:
  hello-world:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Load secret
        id: load_secrets
        uses: 1password/load-secrets-action@v5
        env:
          OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
          SECRET: op://app-cicd/hello-world/secret
          OP_ENV_FILE: "./path/to/.env.tpl" # see tests/.env.tpl for example

      - name: Print masked secret
        run: 'echo "Secret: ${{ steps.load_secrets.outputs.SECRET }}"'
        # Prints: Secret: ***

Export secrets as env variables

on: push
jobs:
  hello-world:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Load secret
        uses: 1password/load-secrets-action@v5
        with:
          # Export loaded secrets as environment variables
          export-env: true
        env:
          OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
          SECRET: op://app-cicd/hello-world/secret
          OP_ENV_FILE: "./path/to/.env.tpl" # see tests/.env.tpl for example

      - name: Print masked secret
        run: 'echo "Secret: $SECRET"'
        # Prints: Secret: ***

🔑 SSH Key Format

When loading SSH keys, you can specify the format using the ssh-format query parameter. This is useful when you need the private key in a specific format like OpenSSH.

- name: Load SSH key
  uses: 1password/load-secrets-action@v5
  env:
    OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
    # Load SSH private key in OpenSSH format
    SSH_PRIVATE_KEY: op://vault/item/private key?ssh-format=openssh

For more details on secret reference syntax, see the 1Password CLI documentation.

🪪 Workload Identity (public preview)

Note 注意

Workload Identity is in public preview. Contact 1Password if you have questions or feedback.

Instead of a Service Account token or Connect credentials, you can authenticate using Workload Identity, which exchanges your GitHub Actions OIDC token for short-lived 1Password access. To use it, set all three of the following environment variables (and do not set the Service Account token or the Connect variables):

on: push
jobs:
  hello-world:
    runs-on: ubuntu-latest
    permissions:
      id-token: write # required for the action to request a GitHub OIDC token
      contents: read
    steps:
      - name: Load secret
        id: load_secrets
        uses: 1password/load-secrets-action@v5
        env:
          OP_WORKLOAD_ID: ${{ vars.OP_WORKLOAD_ID }}
          OP_ENVIRONMENT_ID: ${{ vars.OP_ENVIRONMENT_ID }}
          OP_INTEGRATION_KEY: ${{ secrets.OP_INTEGRATION_KEY }}

Unlike the Service Account and Connect flows, you don’t select secrets with individual op:// references. Instead, all variables defined in the configured 1Password environment are loaded and each one is exported as an environment variable (or set as a step output). Scope your environment to only the variables you want available to the job.

If only some of the three variables are set, or if they’re combined with another authentication method, the action fails with a configuration error.

💙 Community & Support

🔐 Security

1Password requests you practice responsible disclosure if you discover a vulnerability.

Please file requests by sending an email to [email protected].

评论

暂无评论