DEV Community

loading...
Cover image for Manage GitHub Actions secrets with a CLI

Manage GitHub Actions secrets with a CLI

unfor19 profile image Meir Gabay Updated on ・1 min read

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

GitHub logo unfor19 / githubsecrets

Manage your GitHub Actions secrets with a simple CLI

Demo

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

Quickstart

Install with pip

$ pip install githubsecrets
...
$ ghs init
...
$ ghs --help # to view available commands
Enter fullscreen mode Exit fullscreen mode

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]...
...
Enter fullscreen mode Exit fullscreen mode

Windows

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

Final words

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

Design by facebook.com/KerenOrDesign

Discussion (0)

Forem Open with the Forem app