gh(1)

NAME

gh-secret-set - Create or update secrets

SYNOPSIS

gh secret set [flags]

DESCRIPTION

Locally encrypt a new or updated secret at either the repository, environment, or organization level and send it to GitHub for storage.

OPTIONS

-b, --body=""
    A value for the secret. Reads from STDIN if not specified.

-e, --env=""
    Set a secret for an environment

-o, --org=""
    Set a secret for an organization

-r, --repos=[]
    List of repository names for selected visibility

-v, --visibility="private"
    Set visibility for an organization secret: all, private, or selected

OPTIONS INHERITED FROM PARENT COMMANDS

--help[=false]
    Show help for command

-R, --repo=""
    Select another repository using the [HOST/]OWNER/REPO format

EXAMPLE

    Paste secret in prompt
    $ gh secret set MYSECRET
    Use environment variable as secret value
    $ gh secret set MYSECRET  -b"${ENV_VALUE}"
    Use file as secret value
    $ gh secret set MYSECRET < file.json
    Set environment level secret
    $ gh secret set MYSECRET -bval --env=anEnv
    Set organization level secret visible to entire organization
    $ gh secret set MYSECRET -bval --org=anOrg --visibility=all
    Set organization level secret visible only to certain repositories
    $ gh secret set MYSECRET -bval --org=anOrg --repos="repo1,repo2,repo3"

SEE ALSO

gh-secret(1)