live-codes / pr-comment-from-artifact

Post PR Comment from Artifact
MIT License
0 stars 2 forks source link

syntax error #1

Closed hanspagel closed 5 months ago

hanspagel commented 6 months ago

Thanks for building this action! I just wanted to give it a try, but it’s throwing an exception for me. I’ll move on and try to find another solution, but wanted to make sure you know about the issue. :v:

SyntaxError: Unexpected token ','
    at new AsyncFunction (<anonymous>)
    at callAsyncFunction (/home/runner/work/_actions/actions/github-script/v7/dist/index.js:35424:16)
    at main (/home/runner/work/_actions/actions/github-script/v7/dist/index.js:35522:26)
    at /home/runner/work/_actions/actions/github-script/v7/dist/index.js:35497:1
    at /home/runner/work/_actions/actions/github-script/v7/dist/index.js:35553:3
    at Object.<anonymous> (/home/runner/work/_actions/actions/github-script/v7/dist/index.js:35556:12)
    at Module._compile (node:internal/modules/cjs/loader:1241:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1295:10)
    at Module.load (node:internal/modules/cjs/loader:1091:32)
    at Module._load (node:internal/modules/cjs/loader:938:12)
Error: Unhandled error: SyntaxError: Unexpected token ','
hatemhosny commented 6 months ago

thanks @hanspagel for reporting this.

Can you please share some code for how you used the action? I know the action is being used successfully on other repos. This is an example on Jotai: https://github.com/pmndrs/jotai/pull/2426#issuecomment-1970199029

More info: https://github.com/live-codes/preview-in-livecodes

ulrikstrid commented 5 months ago

The failing line seems to be this one: https://github.com/live-codes/pr-comment-from-artifact/blob/main/action.yml#L45 I'm getting the following in my action:

  with:
    script: var artifacts = await github.rest.actions.listWorkflowRunArtifacts({
      owner: context.repo.owner,
      repo: context.repo.repo,
      run_id: ,
  });