LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

gh-secret-set

Create or update GitHub Actions encrypted secrets

TLDR

Set secret interactively
$ gh secret set [SECRET_NAME]
copy
Set secret from value
$ echo "[value]" | gh secret set [SECRET_NAME]
copy
Set from file
$ gh secret set [SECRET_NAME] < [secret.txt]
copy
Set environment secret
$ gh secret set [SECRET_NAME] --env [production]
copy
Set with body flag
$ gh secret set [SECRET_NAME] --body "[value]"
copy

SYNOPSIS

gh secret set name [options]

DESCRIPTION

gh secret set creates or updates encrypted secrets for GitHub Actions. When run interactively, it prompts for the secret value securely without echoing to the terminal.The command encrypts secrets using repository or organization public keys before transmission. Secrets can be scoped to specific environments for deployment workflows or to selected repositories in organizations. Pipe or redirect input to avoid exposing secrets in shell history.

PARAMETERS

NAME

Secret name.
--body VALUE
Secret value (avoid for sensitive data).
--env ENVIRONMENT
Target deployment environment.
--org ORGNAME
Set organization secret.
--repos REPOS
Limit to specific repositories.
--visibility SCOPE
Secret visibility scope.
--help
Display help information.

INSTALL

sudo apt install gh
copy
sudo dnf install gh
copy
sudo pacman -S github-cli
copy
sudo apk add github-cli
copy
sudo zypper install gh
copy
brew install gh
copy
nix profile install nixpkgs#gh
copy

CAVEATS

Avoid --body for sensitive values (visible in history). Secrets encrypted in transit. Organization secrets need admin permissions.

HISTORY

gh secret set is part of the GitHub CLI's secret management commands, providing secure secret configuration for CI/CD workflows.

SEE ALSO

gh-secret(1), gh-run(1)

RESOURCES

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid