Documentation ¶
Overview ¶
newreposecretwithxcrypto creates a new secret in GitHub for a given owner/repo. newreposecretwithxcrypto uses x/crypto/nacl/box instead of sodium. It does not depend on any native libraries and is easier to cross-compile for different platforms. Quite possibly there is a performance penalty due to this.
newreposecretwithxcrypto has two required flags for owner and repo, and takes in one argument for the name of the secret to add. The secret value is pulled from an environment variable based on the secret name. To authenticate with GitHub, provide your token via an environment variable GITHUB_AUTH_TOKEN.
To verify the new secret, navigate to GitHub Repository > Settings > left side options bar > Secrets.
Usage:
export GITHUB_AUTH_TOKEN=<auth token from github that has secret create rights> export SECRET_VARIABLE=<secret value of the secret variable> go run main.go -owner <owner name> -repo <repository name> SECRET_VARIABLE
Example:
export GITHUB_AUTH_TOKEN=0000000000000000 export SECRET_VARIABLE="my-secret" go run main.go -owner google -repo go-github SECRET_VARIABLE