ci(unity): grant contents:write so unity-nuget-test can see draft releases#6081
Merged
Conversation
… releases PR #6073 swapped BUILD_MACHINE_TOKEN for github.token in the unity nuget test, but unity-nuget-test.yml still declared contents:read at the workflow level. The .nupkg lives on a draft release, and GitHub only lists draft releases for callers with push (write) access — so `gh release download <tag>` now returns "release not found" against the draft, breaking the scheduled run. Bump the workflow permission to contents:write to match the other workflows updated in #6073.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PR #6073 swapped
BUILD_MACHINE_TOKENforgithub.tokenacross CI workflows but leftunity-nuget-test.ymldeclaringcontents: readat the workflow level. The.nupkglives on a draft release, and GitHub's REST API only lists draft releases for callers with push (write) access — so the read-onlyGITHUB_TOKENnow getsrelease not foundagainst the draft, andgh release downloadfails.Concrete failure: run 25607068360 / unity-nuget-test
The job's
GITHUB_TOKEN Permissionsblock in the log showsContents: read / Metadata: read, which matches the workflow-level declaration.This PR bumps the workflow permission to
contents: writeto match the other reusable workflows updated in #6073 (build-test-distribute.yml,distro-release.yml,release-body-update.yml,versioning-release.yml).Test plan
Build Test Distributerun on master succeeds at thewindows-unity-test / unity-nuget-testjob, orworkflow_dispatchofunity-nuget-test.ymlwith an existing draftrelease_tagsucceeds at the Download nuget package step