docs(readme): update usage section (#12)

This commit is contained in:
Luis H. Ball Jr 2021-11-18 21:26:25 -08:00 committed by Luis Ball
parent 921996c7ba
commit a1853ff0d5
1 changed files with 16 additions and 11 deletions

View File

@ -49,19 +49,21 @@ $ cd gh-stack
$ cargo install --force --path .
```
```bash
# Required.
# Make sure to give your token read/write access to repositories you want to manage.
$ export GHSTACK_OAUTH_TOKEN='<personal access token>'
# Optional, but recommended.
# If you don't supply this environment variable, you have to pass the `--repository` or `-r` flag to `gh-stack` commands.
$ export GHSTACK_TARGET_REPOSITORY='<github repository name>'
```
You can also store these tokens in a file named `.gh-stack.env` in the project root.
## Usage
> Note: If you don't have a personal access token, you can generate one here:
> https://github.com/settings/tokens. Give your token `repo` scope permissions.
```bash
# Set the environment variable for the Github API token
$ export GHSTACK_OAUTH_TOKEN='<personal access token>'
# Set the environment variable for the repository owner/name
$ export GHSTACK_TARGET_REPOSITORY='<github repository name>'
# You can also set these in a `.gh-stack.env` file in the project root.
```
```bash
$ gh-stack
@ -84,6 +86,9 @@ $ gh-stack log 'stack-identifier'
# to the description of each PR in the stack for a specific repository.
$ gh-stack annotate 'stack-identifier'
# Same as above, but for the specified repository.
$ gh-stack annotate 'stack-identifier' -r '<some/repo>'
# Same as above, but precede the markdown table with the
# contents of `filename.txt`.
$ gh-stack annotate 'stack-identifier' -p filename.txt