Skip to content

This is a tool to manage and automate GitHub Actions Secrets modifications.

License

Notifications You must be signed in to change notification settings

rennf93/github-actions-secrets-mgmt

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

Repository files navigation

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

About

This is a tool to manage and automate GitHub Actions Secrets modifications.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •