How can I add a secret in GitHub Actions using my terminal?

Meir Gabay

I know I can add secrets using the GUI. I also know it's possible to use the new GitHub Actions Secrets API

What I need is a simple way to add, update, delete and list secrets in my GitHub repository, using my terminal only. By using a CLI, it will ease my day-to-day work, and also allow me to rotate secrets in my GitHub Actions CI/CD processes.

Is there a CLI or anything like that?

Meir Gabay

I've created a simple CLI that can help you achieve that - https://github.com/unfor19/githubsecrets

This CLI is based on the official GitHub Actions Secrets API

Install with pip

$ pip install githubsecrets
...
$ ghs --help
...

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]...

Windows

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

Usage-Demo

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Github Actions - How can I save secret to file

How do I pass a Github secret into kubernetes yaml files using github actions workflow

How can I push changes to a private repository using github actions

How can I add a secret file to Heroku that I don't want on the GitHub source (Python)

How i can comit and push with GitHub Actions

How can I add code from Github into my Codepen project?

How can I lock my Ubuntu phone using the terminal?

How can I reference other actions from my GitHub Action's action.yml file?

Add to the path using Github Actions

How can I get an R environment via Sys.getenv() with GitHub Actions using secrets?

How can I git fetch && git checkout from GitHub Actions using Azure CLI?

How can I reject push from repository members using GitHub Actions?

How can I add more buttons for other actions without messing up my virtual joystick?

How do I add output of azure cli command to github actions

How to test my python package using GItHub Actions?

How to get a tag from a branch in my repository using github actions?

How can I get back my Terminal?

How can I install my printer by terminal?

How can I see my password on the terminal?

How can I add a private package from GitHub with my user and password to my pubspec.yaml?

How can I find the service principal secret of my AKS cluster?

How can I use pip cache in github actions?

GitHub Actions: How can I cache the Docker images for Testcontainers?

How can I automate a (usually) interactive build script with Github Actions?

How can I trigger GitHub Actions when pushing to an open PR?

How can I use private docker image in github actions

How can I show the three statuses of GitHub Actions jobs?

How I can get a github actions runner token

How can I download the build file from github actions?