MCPcopy Index your code
hub / github.com/1Password/load-secrets-action

github.com/1Password/load-secrets-action @v4.0.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v4.0.1 ↗ · + Follow
41 symbols 111 edges 31 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
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 or 1Password Connect.

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

Export secrets as a step's output (recommended)

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@v4
        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@v4
        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@v4
  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.

💙 Community & Support

🔐 Security

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

Please file requests by sending an email to bugbounty@agilebits.com.

Extension points exported contracts — how you extend this code

Installer (Interface)
(no doc) [6 implementers]
src/op-cli-installer/github-action/cli-installer/installer.ts
VersionResponse (Interface)
(no doc)
src/op-cli-installer/version/constants.ts

Core symbols most depended-on inside this repo

validateVersion
called by 11
src/op-cli-installer/version/validate.ts
resolve
called by 8
src/op-cli-installer/version/version-resolver.ts
get
called by 7
src/op-cli-installer/version/version-resolver.ts
extractSecret
called by 6
src/utils.ts
getLatestVersion
called by 6
src/op-cli-installer/version/helper.ts
installCliOnGithubActionRunner
called by 6
src/op-cli-installer/github-action/index.ts
loadSecrets
called by 5
src/utils.ts
installCli
called by 5
src/op-cli-installer/github-action/cli-installer/installer.ts

Shape

Method 17
Function 11
Class 10
Interface 2
Enum 1

Languages

TypeScript100%

Modules by API surface

src/op-cli-installer/version/version-resolver.ts7 symbols
src/op-cli-installer/github-action/cli-installer/windows.ts5 symbols
src/op-cli-installer/github-action/cli-installer/macos.ts5 symbols
src/op-cli-installer/github-action/cli-installer/cli-installer.ts5 symbols
src/utils.ts4 symbols
src/op-cli-installer/github-action/cli-installer/linux.ts4 symbols
src/op-cli-installer/github-action/cli-installer/installer.ts3 symbols
src/op-cli-installer/version/constants.ts2 symbols
src/index.ts2 symbols
src/op-cli-installer/version/validate.ts1 symbols
src/op-cli-installer/version/helper.ts1 symbols
src/op-cli-installer/github-action/index.ts1 symbols

For agents

$ claude mcp add load-secrets-action \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact