How to use comment-on-github-pull-request to post in Pull Request

Hi! , I’m trying to use the comment-on-github-pullrequest step to post in my PRs, but it fails to fail retrieve PR comments

%!(EXTRA *github.ErrorResponse=POST https://api.github.com/repos/REDACTED]/issues/12150/comments: 404 Not Found )

I configure the step to put a comment in my draft PR 12150 , my GIT_REPOSITORY_URL has the same value than the clone path

 - comment-on-github-pull-request@0.11.0:
          inputs:
            - personal_access_token: "$BITRISE_PR_COMMENT_TOKEN"
            - body: "Test comment"
            - repository_url: "$GIT_REPOSITORY_URL"
            - issue_number: 12150

Am I missing something?

Hey, there could be a number of issues causing this. If I recall correctly GitHub returns 404 even if it’s an authorization error.

First, I’d check if your $BITRISE_PR_COMMENT_TOKEN is actually enabled to be exposed to pull requests. We don’t do a good job letting you know that it’s not:

If that’s okay, it will most likely be something with the token itself. If it’s the fine-grained token, it needs the following permissions:

You can configure your access token here: Sign in to GitHub · GitHub

If this doesn’t help, please post a build slug of a failed build.

2 Likes

Yup, it was a token issue. The step is working like a charm

Thanks!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.