Closed 0x2b3bfa0 closed 1 year ago
Oh, thanks, this is definitely better. Why GH_REPO
and why GH_TOKEN
instead of GITHUB_TOKEN
as documented in https://docs.github.com/en/actions/using-workflows/using-github-cli-in-workflows.
_Why
GH_REPO
_
Because the upload
job does not use the checkout
action. Thus, when gh
is run, it won't find a Git repository nor know where to upload the artifacts.
$ git release upload ...
fatal: not a git repository (or any of the parent directories): .git
/usr/local/bin/git: exit status 128
The easiest ways of specifying the target repository are either specifying the --repo
option or setting the GH_REPO
environment variable.
_Why
GH_TOKEN
instead ofGITHUB_TOKEN
_
Just for foolish consistency with the GH_REPO
environment variable; feel free to use GITHUB_TOKEN
if you deem it more appropriate. The same applies for github.token
versus secrets.GITHUB_TOKEN
to retrieve it.
That all makes sense, thank you!
Uses
gh release upload
for the sake of pipeline code golfing, if that's a thing.