Skip to content

Commit ba7a8d9

Browse files
authored
Fix authorization issue when creating a GitHub release.
The envvar `GITHUB_TOKEN` that is defined for the step that runs `gh release up` must also be defined for the step that runs `gh release create`. This change removes the definition from the step, and adds it to the job so that the envvar is available to all steps in the job. This fixes the authorization issue that can be seen [here](https://github.com/uclahs-cds/BL_Python/actions/runs/6658013371/job/18093994984). Note: the output of the Action specifies `GH_TOKEN`, but in fact either `GH_TOKEN` or `GITHUB_TOKEN` can be defined per [gh environment](https://cli.github.com/manual/gh_help_environment).
1 parent 7b5c563 commit ba7a8d9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

source/guides/github-actions-ci-cd-sample/publish-to-test-pypi.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ jobs:
6161
contents: write # IMPORTANT: mandatory for making GitHub Releases
6262
id-token: write # IMPORTANT: mandatory for sigstore
6363

64+
env:
65+
GITHUB_TOKEN: ${{ github.token }}
66+
6467
steps:
6568
- name: Download all the dists
6669
uses: actions/download-artifact@v3
@@ -80,8 +83,6 @@ jobs:
8083
--repo '${{ github.repository }}'
8184
--notes ""
8285
- name: Upload artifact signatures to GitHub Release
83-
env:
84-
GITHUB_TOKEN: ${{ github.token }}
8586
# Upload to GitHub Release using the `gh` CLI.
8687
# `dist/` contains the built packages, and the
8788
# sigstore-produced signatures and certificates.

0 commit comments

Comments
 (0)