Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

GitHub Actions

Summary: let a workflow read one environment, with one repository secret.

On your computer, with the GitHub CLI gh logged in:

secrets-chad machine create deploy -e shop/prod --github                 # this repository
secrets-chad machine create deploy -e shop/prod --github=org/repo --github-env production

It checks that gh can store secrets there, asks, waits for your approval in the browser, and gives the credential to gh secret set SECRETS_DEVICE on stdin. The credential is in no file, argument or output. It prints the workflow lines:

steps:
  - uses: audiochad/secrets@v0.1.0-alpha.2
  - run: secrets-chad -e shop/prod run -- ./deploy.sh
    env:
      SECRETS_DEVICE: ${{ secrets.SECRETS_DEVICE }}
  • The Action installs secrets-chad from the releases of audiochad/secrets. Its version input picks another release.
  • Set SECRETS_DEVICE for the steps that need it only.
  • End access with secrets-chad -e shop/prod machine revoke deploy; the next job fails.

Wiki: A machine in a GitHub Actions job.