This Actions project provides a tool to manage GitHub Actions secrets programmatically.
- Retrieve environment variables
- Generate authentication headers
- Retrieve public key details from GitHub
- Encrypt secrets using NaCl
- Save secrets to GitHub Actions
- Python 3.11+
requestslibraryPyNaCllibrary
- 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.
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.
