Skip to content

GitHub Actions Secrets Management

Actions
A GitHub Action to manage GitHub Actions secrets programmatically
v1.5
Latest
Star (12)

github-actions-secrets-mgmt

This Actions project provides a tool to manage GitHub Actions secrets programmatically.


Features

  • Retrieve environment variables
  • Generate authentication headers
  • Retrieve public key details from GitHub
  • Encrypt secrets using NaCl
  • Save secrets to GitHub Actions

Requirements

  • Python 3.11+
  • requests library
  • PyNaCl library

Usage

- name: Create or update Github Actions secret
  uses: rennf93/github-actions-secrets-mgmt@v1.0
  with:
    OWNER: <github_handle>
    REPOSITORY: <target_repository>
    ACCESS_TOKEN: <personal_access_token>
    SECRET_NAME: <secret>
    SECRET_VALUE: <output-from-previous-step>

where

OWNER is the owner of the repository where the secret is to be created or updated. Required.

REPOSITORY is the name of the respository where the secret is to be created or updated. Required.

ACCESS_TOKEN is the personal access token (PAT) to use for authentication against the repository where the secret is stored. Using secrets.GIHUB_TOKEN will not work. Follow steps here to create one if you dont already have one. Besure to allow the token to be used to read user public keys.

Required: permission

SECRET_NAME is the name of the secret to be created or updated. Required.

SECRET_VALUE is value the secret should be set to. Optional. This should be an output from a previous step or job. For reference: here

To view the newly created secret, navigate to settings >> secrets >> actions in the Github repository portal.


References

  1. Create personal access token
  2. Get repository public key
  3. Create or update a repository secret
  4. Custom actions

Custom Badge

GitHub Actions Secrets Management is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

A GitHub Action to manage GitHub Actions secrets programmatically
v1.5
Latest

GitHub Actions Secrets Management is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.