octokit / request-action

A GitHub Action to send arbitrary requests to GitHub's REST API
https://github.com/marketplace/actions/GitHub-API-Request
MIT License
362 stars 48 forks source link

[BUG]: Attempting GET on a Github commit API fails #276

Closed ajmmm closed 9 months ago

ajmmm commented 9 months ago

What happened?

When attempting to use the action to perform a GET on the following API, the action fails:

...
      uses: octokit/request-action@v2.x
      with:
        route: GET /repos/${{ github.repository }}/commits/${{ github.sha }}/pulls
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Attempted it a few different ways - even with a manually specified SHA.

Versions

Octokit v2.x Node 10.24 (RHEL 8)

Relevant log output

/root/.cache/act/36476ce2c9b7795f/act/actions/octokit-request-action@v2.x/dist/index.js:1905
  static {
         ^

SyntaxError: Unexpected token {
    at Module._compile (internal/modules/cjs/loader.js:723:23)
Error:   ❌  Failure - Main Get SHA pulls
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
Error: exit status 1
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
🏁  Job failed
Error: exit status 1

Code of Conduct

github-actions[bot] commented 9 months ago

πŸ‘‹ Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labled with Status: Up for grabs. You & others like you are the reason all of this works! So thank you & happy coding! πŸš€

ajmmm commented 9 months ago

Actual nodejs build versions:

nodejs-full-i18n-10.24.0-1.module+el8.3.0+101+f84c7154.x86_64
nodejs-10.24.0-1.module+el8.3.0+101+f84c7154.x86_64
gr2m commented 9 months ago

Node Node 10.24 is out of maintenance for a long, long time, we cannot support it and highly recommend from upgrading to a maintained Node version (Node 18+, see https://github.com/nodejs/release#release-schedule).

ajmmm commented 9 months ago

Node Node 10.24 is out of maintenance for a long, long time, we cannot support it and highly recommend from upgrading to a maintained Node version (Node 18+, see https://github.com/nodejs/release#release-schedule).

I did wonder if it was the Node version -- looks like RHEL 8 ship nodejs modules up to 18. Will give that a try and feed back.

ajmmm commented 9 months ago

Confirmed -- new versions from nodejs:18 work :-)

nodejs-full-i18n-18.16.1-1.module+el8.8.0+1413+a47876c7.x86_64
nodejs-18.16.1-1.module+el8.8.0+1413+a47876c7.x86_64
nodejs-docs-18.16.1-1.module+el8.8.0+1413+a47876c7.noarch

Thank you!