Manage GitHub Actions Secrets With A CLI


TL;DR For those of you who are using Github Actions, I've created a githubsecrets cli - unfor19/githubsecrets


The Why

  • Using CLI is faster than using GUI, especially if it's a repetitive task
  • Quickly rotating keys/secrets in CI/CD processes
  • I didn't have access to the Settings tab of my customer's GitHub repository, and I had to add a secret - so I used the API, and it was exhausting, so I wrote this CLI


Install with pip

$ pip install githubsecrets
$ ghs init
$ ghs --help # to view available commands

Use in Docker

Or use with Docker (you must supply all arguments, prompts are not available in Docker mode)

macOS and Linux

$ docker run -v $HOME:/root unfor19/githubsecrets --help
Usage: ghs [OPTIONS] COMMAND [ARGS]...


$ docker run --rm -v c:/Temp:/root unfor19/githubsecrets --help
Usage: ghs [OPTIONS] COMMAND [ARGS]...

Final words

I hope that this CLI tool helped you, and if it did, then 👏/💟/🐴 and share!

Design by

Originally posted at on April 14, 2020.