Closed rishubil closed 3 years ago
There was a lock file update in that time frame. Can you check if the error persist with the prior version (01a594f812f65f72258093beb52b2b89429eb853)
octokit/request-action@01a594f812f65f72258093beb52b2b89429eb853
I just applied and tested it, but It's still the same. When the problem occurred, I was using a specific version(octokit/request-action@v2.0.0) so I don't think it's an issue related to that.
I think I should test it using curl directly in github action.
I tried to use curl by accessing github action with ssh using debugging-with-tmate. I have checked that 204 will be returned normally if requested by curl. It's hard to understand why this is happening, is there anything else I can test?
I tried to reproduce your problem, but no luck.
Here is my workflow file:
Here is the action run
https://github.com/gr2m/sandbox/runs/1963580718
I'm running out of ideas what the problem might be. Can you try this?
- uses: octokit/request-action@v2.x
with:
route: GET /repos/:repository/collaborators/rishubil
repository: ${{ github.repository }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
If that is failing, can you copy and past my debug.yml
file into your repository and run the workflow using the manual dispatch? Make sure to replace gr2m
with rishubil
If that's all failing, I'd suggest you contact support, they will be able to help you better: https://support.github.com/contact
I don't know why, but about 9 hours ago, github action started returning 204 normally! Perhaps it was an issue of github action itself.
Thank you for your kind response.
no worries! Glad to hear it's all working again!
Apologies for commenting on a closed issue but I seem to be running into this. No matter what I do the action always fails with a 404 and nothing in the debug logs looks out-of-place.
I tried creating a new PAT with the repo
scope and using that and yet I can't seem to be able to call the /releases
API using this GH action. The same token works just fine when I make a curl
request directly.
Most likely an authentication problem. What do you pass as GITHUB_TOKEN
? If you set it to ${{ secrets.GITHUB_TOKEN }}
, is the request going to the same repository where you run the action? If not, then you will need a different means of authentication
Yeah the request is going to the same repo which is private. Suspecting a problem with the token perms, I created a new PAT and mapped that to GITHUB_TOKEN
in the env
map for the step. That still does not work with this action. As noted in my earlier comment, I can make the API call manually using curl
with that new token just fine.
🤦♂️ so it was my fault. The action is working just fine. I was calling the wrong URL in the action. To be able to get a release by a tag, the correct endpoint is repos/:repository/releases/tags/:tag_name
. When I ran the curl
test I ran one from my command history where I evidently had the correct URL. I can't tell you how silly I feel right now!
Glad you got it working!
🤔 we could compare the path to all known pats based on the OpenAPI spec, might have saved you and probably many others lots of headaches. We could log a warning? What do you think
@gr2m hmm I don't think I follow...
Here is how it would work in case anyone wants to work on it:
The setup would work similar to how https://github.com/octokit/plugin-paginate-rest.js updates src/generated/paginating-endpoints.ts.
update-endpoints
script that will take the OpenAPI specification from @octokit/openapi
, create/update a generated/rest-api-routes.js
file, which would be an array of all REST API routes that GitHub supportsgenerated/rest-api-routes.js
. If the route is unknown, log a warning if the response is a 404.No worries if that doesn't make sense @praneetloke, there is lots of inside knowledge behind how the automated updates work for the@octokit/*
packages based updates to GitHub's OpenAPI specifications
I have been using request-action normally at https://github.com/yf-dev/majsoul-plus-korean until yesterday.
However, about 11 hours ago, I found that the return value of API requests using request-action was changed to 404 without any reason.
I checked the request in request-action debug logs and tried to request it again through curl on the local computer as it is, but I was confused when I saw API returned 204 well.
Is there anything else I can check?
Debug log
Curl log