Skip to content

release doctor: forge-access fails with GitHub Actions' GITHUB_TOKEN in a job that has contents: write #5299

Open

Description

@lex00

Part of #5148. Seen in INTENTIUS/mudflaps run 44189945528 and INTENTIUS/m80 run 44189946360. Both cut jobs have permissions: contents: write and GITHUB_TOKEN: ${{ github.token }}, and chant release doctor (0.124.104) fails:

FAIL forge-access: the token in GITHUB_TOKEN may read INTENTIUS/mudflaps and not write it

The job's token can write: the wardens' cuts pushed tags from the same job shape with doctor off. A GitHub Actions installation token gets no permissions object from GET /repos/{owner}/{repo}, so a check that reads it can't see write access. In Actions, doctor should either read the job's declared permissions from the workflow file (GITHUB_WORKFLOW_REF and GITHUB_JOB) or report can't-tell for a GITHUB_TOKEN, not FAIL. Under --from cut (#5298), forge write used by the publish job should be reported the same way as the OIDC checks. Until this is fixed, repos with a forge target need release.workflow.doctor: false.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions