Skip to content

gh pr ready doesn't work with GitHub Actions' GITHUB_TOKEN secret #8910

@suzuki-shunsuke

Description

@suzuki-shunsuke

Describe the bug

A clear and concise description of what the bug is. Include version by typing gh --version.

$ gh version
gh version 2.46.0 (2024-03-20)
https://github.com/cli/cli/releases/tag/v2.46.0

gh pr ready doesn't work with GitHub Actions' GITHUB_TOKEN secret.

The error message is API call failed: GraphQL: Resource not accessible by integration (markPullRequestReadyForReview).

I found the same issue, but the issue should have already been solved.

Steps to reproduce the behavior

  1. Type this '...'
  2. View the output '....'
  3. See error

Run gh pr ready with GitHub Actions' GITHUB_TOKEN secret.

---
name: test
on: pull_request
jobs:
  test:
    runs-on: ubuntu-latest
    permissions:
      pull-requests: write
    steps:
      - run: gh version
      - run: gh -R "$GITHUB_REPOSITORY" pr ready 1
        env:
          GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

https://github.com/suzuki-shunsuke/test-gh-pr-ready-with-github-token-secret/actions/runs/8522674476/job/23343382304

Expected vs actual behavior

A clear and concise description of what you expected to happen and what actually happened.

Logs

Paste the activity from your command line. Redact if needed.

Run gh -R "$GITHUB_REPOSITORY" pr ready 1
  gh -R "$GITHUB_REPOSITORY" pr ready 1
  shell: /usr/bin/bash -e {0}
  env:
    GITHUB_TOKEN: ***
API call failed: GraphQL: Resource not accessible by integration (markPullRequestReadyForReview)
Error: Process completed with exit code 1.

https://github.com/suzuki-shunsuke/test-gh-pr-ready-with-github-token-secret/actions/runs/8522616582/job/23343198723?pr=1#step:2:7

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingneeds-investigationCLI team needs to investigate

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions