-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Closed
Labels
bugSomething isn't workingSomething isn't workinghelp wantedContributions welcomeContributions welcomepriority-2Affects more than a few users but doesn't prevent core functionsAffects more than a few users but doesn't prevent core functions
Description
Describe the bug
gh issue comment fails with GraphQL error: Resource not accessible by integration when used with a GitHub Actions token that doesn't have repository-projects: read permission.
Occurs with GitHub CLI 2.2.0 (current default on ubuntu-latest on Actions).
Steps to reproduce the behavior
- Find an existing issue on a repo.
- Create a GitHub Actions workflow on the same repo with the following:
on:
workflow_dispatch:
jobs:
create-comment:
name: Create comment
permissions:
contents: read
issues: write
# repository-projects: read # fails without this
steps:
- name: Create comment
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
run: |
set -x
gh issue comment https://github.com/$GITHUB_REPOSITORY/issues/$number --body "comment body" # replace $number- Run the workflow and see error.
- Uncomment the
repository-projects: readpermission, run the workflow again, and see success.
Expected vs actual behavior
Expected: gh issue comment successfully creates an issue comment even if the token doesn't have permission to access repo projects.
Logs
GraphQL error: Resource not accessible by integration
Error: Process completed with exit code 1.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinghelp wantedContributions welcomeContributions welcomepriority-2Affects more than a few users but doesn't prevent core functionsAffects more than a few users but doesn't prevent core functions