Closed jason-curtis closed 8 months ago
Hi @jason-curtis
In the backend of GitHub, pull requests are extended issues. They use the same API. So the action is correct to try and find an issue with that number.
If you are consistently getting a 404 from the API then that would probably indicate that the token you are using doesn't have the correct permissions to access the repository contents.
COMMENTING_ACCESS_TOKEN
secret actually contains the full PAT and hasn't been accidentally truncated. Copy/paste it again.repo
for classic tokens.Ah, I see. Thank you for the response! I forgot that GH likes to return 404s instead of 401s, and I was confused because I had earlier had an explicit permissions error (something like this token does not have access to this resource
).
In any case, I worked around it by using the GITHUB_TOKEN
directly and setting up permissions within the action:
permissions:
contents: read
pull-requests: write
I also ended up using @mshick/add-pr-comment since it was a bit more straightforward for my use case.
I'm using an example from the README, but on initial PR creation, the step that uses
peter-evans/find-comment@v3
is failing with the error messageError: Not Found
.Example in the README:
Here is my exact YAML
Full log output: https://gist.github.com/jason-curtis/ab29324877cccd8da957e7ab439cdcd1
It appears that even though I'm running on a pull request with a pull request ID, the action is attempting to find a GitHub issue with that number, and it is failing when it receives a 404 response from GitHub.
This project is not using GitHub issues at all, so when the action tries to access
https://api.github.com/repos/carbon-yield/farm-data/issues/9/comments
, a 404 error is expected!