Dependencies are openssl, curl, jq and gh.
Prepare environment:
export GITHUB_APP_ID=...
export GITHUB_APP_PK_FILE=...
export GITHUB_ORG="nhs-england-tools"Run script:
$ cd docs/adr/assets/ADR-003/examples/bash
$ ./script.sh
GITHUB_TOKEN=ghs_...Check the token:
$ GITHUB_TOKEN=ghs_...; echo "$GITHUB_TOKEN" | gh auth login --with-token
$ gh auth status
github.com
β Logged in to github.com as nhs-england-update-from-template[bot] (keyring)
β Git operations for github.com configured to use https protocol.
β Token: ghs_************************************See the example (script.sh) implementation. This script has been written to illustrate the concept in a clear and simple way. It is not a production ready code.