Skip to content

Accessing draft releases is not possible using GITHUB_TOKEN in Actions #3037

@mislav

Description

@mislav

Reported by @simonbrunel in #3029 (reply in thread)

To find a draft release by its tag name, we have to iterate through all releases and look into the draft ones, since there is no API endpoint to directly fetch a draft release. To avoid doing this unnecessarily when a release isn't a draft, we first check whether the viewer has write access to the repo to determine whether they can have access to drafts: #1552

This doesn't work with the generated GITHUB_TOKEN in GitHub Actions, since the viewerPermission object is null, likely due to the nature of GITHUB_TOKEN being a server-to-server integration token.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedContributions welcomeneeds-triageneeds to be reviewedplatformProblems with the GitHub platform rather than the CLI clientpriority-3Affects a small number of users or is largely cosmetic

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions