Skip to content

✅ Retrieve SOPS-encrypted secrets in GitHub Actions.

License

Notifications You must be signed in to change notification settings

nhedger/get-sops-secret

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Get SOPS secret in GitHub Actions

GitHub release (latest SemVer) Test

This actions provides a straightforward way to get a single secret from a SOPS encrypted file and outputs it as a GitHub Actions output.

Inputs

The following inputs are supported.

- name: Get SOPS secret
  uses: nhedger/get-sops-secret@v1
  with:

    # Path to the SOPS encrypted file that contains the secret.
    # Required.
    secrets-file: /path/to/secrets.yaml

    # Name of the secret to retrieve
    # Required.
    secret-name: my-secret

    # AGE private key
    # Required.
    age-private-key: ${{ secrets.AGE_PRIVATE_KEY }}

    # SOPS version to use for decrypting the file.
    # Optional.
    # Default: latest
    sops-version: latest

Outputs

This actions returns single secret output with the value of the secret.

Example

- name: Get SOPS secret
  uses: nhedger/get-sops-secret@v1
  id: get-secret
  with:
    secrets-file: /path/to/secrets.yaml
    secret-name: my-secret
    age-private-key: ${{ secrets.AGE_PRIVATE_KEY }}

- name: Print secret
  run: echo ${{ steps.get-secret.outputs.secret }}

License

The scripts and documentation in this project are licensed under the MIT License.

About

✅ Retrieve SOPS-encrypted secrets in GitHub Actions.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project