Skip to content

MistakeBot: Can't access repo owner programatically #7

@meyersbs

Description

@meyersbs

This query

query issuetext($owner:String!,$repo:String!,$number:Int!) { 
  repository(owner: $owner, name: $repo) {
    thisIssue: issue(number: $number) {
      title
      bodyText
      comments(first: 10) {
        edges {
          node {
            bodyText
          }
        }
      }
    }
  }
}

With these query variables

{
  "owner": "meyersbs",
  "repo": "these-poc",
  "number": 6
}

Works in the explorer: https://docs.github.com/en/graphql/overview/explorer

However, trying to access owner programmatically with the following fails:

- name: Query for Text
  uses: octokit/graphql-action@v2.x
  id: issue-text
  env:
    GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  with:
    query: |
      query issuetext($owner:String!,$repo:String!,$number:Int!) {
        repository(owner:$owner,name:$repo) {
          thisIssue: issue(number:$number) {
            title
            bodyText
            comments(first:10) {
              edges {
                node {
                  bodyText
                }
              }
            }
          }
        }
      }
    number: ${{ github.event.issue.number }}
    repo: ${{ github.event.repository.name }}
    owner: ${{ github.event.repository.owner.name }}

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions