Skip to content

Latest commit

 

History

History
54 lines (38 loc) · 1.26 KB

README.MD

File metadata and controls

54 lines (38 loc) · 1.26 KB

Github Secrets generator

Sets check if a secret is defined in a given github repo, or upload 1 or more secrets to a github repo.

Usage

  1. build the image
$ podman build -t github-secrets-generator .

Or, use ./run.sh

  1. check if a secret already exists in a repo:
$ podman run --rm --entrypoint /checkIfSecretExists.sh github-secrets-generator "${GITHUB_TOKEN}" github-org/github-repo MY_SECRET

Or, use ./run.sh

  1. load 1 or more secrets from a file, assuming each line of the file is in the format:
SECRET_VARIABLE1 SECRET_PLAINTEXT_VALUE1
SECRET_VARIABLE2 SECRET_PLAINTEXT_VALUE2
...

Use ./run.sh

  1. You can also uplod individual secrets, passing these parameters in order:
  • GITHUB_TOKEN
  • github-org/github-repo
  • SECRET_VARIABLE
  • SECRET_PLAINTEXT_VALUE
$ podman run --rm -it github-secrets-generator ${GITHUB_TOKEN} github-org/github-repo SECRET_TOKEN ${SECRET_PLAINTEXT_VALUE}

Or, to save a pair of secrets:

  • GITHUB_TOKEN
  • github-org/github-repo
  • USERNAME_VARIABLE
  • USERNAME_PLAINTEXT_VALUE
  • PASSWORD_VARIABLE
  • PASSWORD_PLAINTEXT_VALUE
$ podman run --rm -it github-secrets-generator ${GITHUB_TOKEN} github-org/github-repo QUAY_USERNAME ${QUAY_USERNAME} QUAY_PASSWORD ${QUAY_PASSWORD}