Forrest logo
back to the gh tool

gh-secret-set:tldr:f2e7f

gh-secret-set: Set an organization secret for specific repositories.
$ gh secret set ${name} --org ${organization} --repos "${repository1,repository2,---}"
try on your machine

This command is used to set a secret on multiple repositories within an organization on GitHub.

Here is a breakdown of the components of this command:

  • gh secret set: This is the command-line interface (CLI) command for setting a secret on GitHub.

  • ${name}: This is a placeholder for the name of the secret you want to set. You need to replace ${name} with the actual name of the secret.

  • --org ${organization}: This flag specifies the organization where the repositories are located. You need to replace ${organization} with the actual name of the organization.

  • --repos "${repository1,repository2,---}": This flag specifies the repositories where the secret should be set. You need to replace "${repository1,repository2,---}" with the actual names of the repositories, separated by commas. Make sure to enclose the repository names within the double quotes (").

So, when you run this command with proper values, it will set the specified secret ${name} on multiple repositories (repository1, repository2, etc.) within the specified organization ${organization}.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the gh tool