Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhandled error: TypeError: Cannot read properties of undefined (reading 'listWorkflowRunArtifacts') #242

Closed
kfiven opened this issue Feb 23, 2022 · 3 comments
Labels
question A question on how to use this action

Comments

@kfiven
Copy link

kfiven commented Feb 23, 2022

Hi, I am using this action to deploy pull requests, see https://github.com/kfiven/cinny/blob/test/.github/workflows/deploy-pull-request.yml

After upgrading to v6 (from v3.1.0) I am getting following error:

TypeError: Cannot read properties of undefined (reading 'listWorkflowRunArtifacts')
[36](https://github.com/kfiven/cinny/runs/5303357611?check_suite_focus=true#step:2:36)
Error: Unhandled error: TypeError: Cannot read properties of undefined (reading 'listWorkflowRunArtifacts')
[37](https://github.com/kfiven/cinny/runs/5303357611?check_suite_focus=true#step:2:37)
    at eval (eval at callAsyncFunction (/home/runner/work/_actions/actions/github-script/v6/dist/index.js:4797:16), <anonymous>:3:[38](https://github.com/kfiven/cinny/runs/5303357611?check_suite_focus=true#step:2:38))
38
    at callAsyncFunction (/home/runner/work/_actions/actions/github-script/v6/dist/index.js:4798:12)
[39](https://github.com/kfiven/cinny/runs/5303357611?check_suite_focus=true#step:2:39)
    at main (/home/runner/work/_actions/actions/github-script/v6/dist/index.js:4852:26)
[40](https://github.com/kfiven/cinny/runs/5303357611?check_suite_focus=true#step:2:40)
    at Module.272 (/home/runner/work/_actions/actions/github-script/v6/dist/index.js:4836:1)
[41](https://github.com/kfiven/cinny/runs/5303357611?check_suite_focus=true#step:2:41)
    at __webpack_require__ (/home/runner/work/_actions/actions/github-script/v6/dist/index.js:24:31)
[42](https://github.com/kfiven/cinny/runs/5303357611?check_suite_focus=true#step:2:42)
    at startup (/home/runner/work/_actions/actions/github-script/v6/dist/index.js:[43](https://github.com/kfiven/cinny/runs/5303357611?check_suite_focus=true#step:2:43):19)
43
    at /home/runner/work/_actions/actions/github-script/v6/dist/index.js:49:18
[44](https://github.com/kfiven/cinny/runs/5303357611?check_suite_focus=true#step:2:44)
    at Object.<anonymous> (/home/runner/work/_actions/actions/github-script/v6/dist/index.js:52:10)
[45](https://github.com/kfiven/cinny/runs/5303357611?check_suite_focus=true#step:2:45)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
[46](https://github.com/kfiven/cinny/runs/5303357611?check_suite_focus=true#step:2:46)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)

See https://github.com/kfiven/cinny/runs/5303357611?check_suite_focus=true#step:2:1

@joshmgross
Copy link
Member

var artifacts = await github.actions.listWorkflowRunArtifacts({
                     owner: context.repo.owner,
                     repo: context.repo.repo,
                     run_id: ${{github.event.workflow_run.id }},
                  });

In V5 of this action, we upgraded Octokit and REST methods now need to be referenced by github.rest - https://github.com/actions/github-script#breaking-changes-in-v5

This should be github.rest.actions.listWorkflowRunArtifacts rather than github.actions.listWorkflowRunArtifacts

@joshmgross joshmgross added the question A question on how to use this action label Feb 23, 2022
@kfiven
Copy link
Author

kfiven commented Feb 24, 2022

Thanks Josh! I somehow missed readme and was looking for breaking changes in releases.

@kfiven kfiven closed this as completed Feb 24, 2022
@joshmgross
Copy link
Member

I somehow missed readme and was looking for breaking changes in releases.

Oops, sorry about that. I should have included that in the release notes, I've updated https://github.com/actions/github-script/releases/tag/v5.0.0 to include this breaking change.

devinrsmith added a commit to devinrsmith/deephaven-core that referenced this issue Mar 22, 2022
hsbt added a commit to rubygems/rubygems.org that referenced this issue Apr 19, 2022
rolfbjarne added a commit to rolfbjarne/xamarin-macios that referenced this issue Oct 5, 2022
…cript.

actions/github-script was recently updated from 3.1.0 to 6.3.1 (69de14c), but unfortunately there were breaking changes:

* https://github.com/actions/github-script#breaking-changes
* actions/github-script#242 (comment)

This would manifest as:

    TypeError: Cannot read properties of undefined (reading 'listWorkflowRunArtifacts')
    Error: Unhandled error: TypeError: Cannot read properties of undefined (reading 'listWorkflowRunArtifacts')
        at eval (eval at callAsyncFunction (/home/runner/work/_actions/actions/github-script/v6.3.1/dist/index.js:13340:16), <anonymous>:3:38)
        at callAsyncFunction (/home/runner/work/_actions/actions/github-script/v6.3.1/dist/index.js:13341:12)
        at main (/home/runner/work/_actions/actions/github-script/v6.3.1/dist/index.js:13436:26)
        at Module.858 (/home/runner/work/_actions/actions/github-script/v6.3.1/dist/index.js:13413:1)
        at __webpack_require__ (/home/runner/work/_actions/actions/github-script/v6.3.1/dist/index.js:24:31)
        at startup (/home/runner/work/_actions/actions/github-script/v6.3.1/dist/index.js:43:19)
        at /home/runner/work/_actions/actions/github-script/v6.3.1/dist/index.js:49:18
        at Object.<anonymous> (/home/runner/work/_actions/actions/github-script/v6.3.1/dist/index.js:52:10)
        at Module._compile (node:internal/modules/cjs/loader:1101:14)
        at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)

So update our code to to use the new way to do things.
rolfbjarne added a commit to xamarin/xamarin-macios that referenced this issue Oct 5, 2022
…cript. (#16240)

actions/github-script was recently updated from 3.1.0 to 6.3.1 (69de14c), but unfortunately there were breaking changes:

* https://github.com/actions/github-script#breaking-changes
* actions/github-script#242 (comment)

This would manifest as:

    TypeError: Cannot read properties of undefined (reading 'listWorkflowRunArtifacts')
    Error: Unhandled error: TypeError: Cannot read properties of undefined (reading 'listWorkflowRunArtifacts')
        at eval (eval at callAsyncFunction (/home/runner/work/_actions/actions/github-script/v6.3.1/dist/index.js:13340:16), <anonymous>:3:38)
        at callAsyncFunction (/home/runner/work/_actions/actions/github-script/v6.3.1/dist/index.js:13341:12)
        at main (/home/runner/work/_actions/actions/github-script/v6.3.1/dist/index.js:13436:26)
        at Module.858 (/home/runner/work/_actions/actions/github-script/v6.3.1/dist/index.js:13413:1)
        at __webpack_require__ (/home/runner/work/_actions/actions/github-script/v6.3.1/dist/index.js:24:31)
        at startup (/home/runner/work/_actions/actions/github-script/v6.3.1/dist/index.js:43:19)
        at /home/runner/work/_actions/actions/github-script/v6.3.1/dist/index.js:49:18
        at Object.<anonymous> (/home/runner/work/_actions/actions/github-script/v6.3.1/dist/index.js:52:10)
        at Module._compile (node:internal/modules/cjs/loader:1101:14)
        at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)

So update our code to to use the new way to do things.
rexut added a commit to tiacsys/bridle that referenced this issue Oct 14, 2022
The actions/github-script was recently updated from v3.1.0 to v6
to catch Node 16 (f49acac), but
unfortunately there were breaking changes in the API with v5:

* https://github.com/actions/github-script#breaking-changes-in-v5
* actions/github-script#242 (comment)

Error was manifest as:

TypeError: Cannot read properties of undefined (reading 'listWorkflowRunArtifacts')
    at eval (eval at callAsyncFunction (/home/runner/work/_actions/actions/github-script/v6/dist/index.js:13355:16), <anonymous>:3:38)
    at callAsyncFunction (/home/runner/work/_actions/actions/github-script/v6/dist/index.js:13356:12)
    at main (/home/runner/work/_actions/actions/github-script/v6/dist/index.js:13451:26)
    at Module.858 (/home/runner/work/_actions/actions/github-script/v6/dist/index.js:13428:1)
    at __webpack_require__ (/home/runner/work/_actions/actions/github-script/v6/dist/index.js:24:31)
    at startup (/home/runner/work/_actions/actions/github-script/v6/dist/index.js:43:19)
    at /home/runner/work/_actions/actions/github-script/v6/dist/index.js:49:18
    at Object.<anonymous> (/home/runner/work/_actions/actions/github-script/v6/dist/index.js:52:10)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)

So update our code to to use the new way to do things.

issues: #62

Signed-off-by: Stephan Linz <[email protected]>
rexut added a commit to tiacsys/bridle that referenced this issue Oct 14, 2022
The actions/github-script was recently updated from v3.1.0 to v6
to catch Node 16 (f49acac), but
unfortunately there were breaking changes in the API with v5:

* https://github.com/actions/github-script#breaking-changes-in-v5
* actions/github-script#242 (comment)

Error was manifest as:

TypeError: Cannot read properties of undefined
           (reading 'listWorkflowRunArtifacts')

So update our code to to use the new way to do things.

issues: #62

Signed-off-by: Stephan Linz <[email protected]>
rexut added a commit to tiacsys/bridle that referenced this issue Feb 19, 2023
The actions/github-script was recently updated from v3.1.0 to v6
to catch Node 16 (f49acac), but
unfortunately there were breaking changes in the API with v5:

* https://github.com/actions/github-script#breaking-changes-in-v5
* actions/github-script#242 (comment)

Error was manifest as:

TypeError: Cannot read properties of undefined
           (reading 'listWorkflowRunArtifacts')

So update our code to to use the new way to do things.

issues: #62 #64

Signed-off-by: Stephan Linz <[email protected]>
rexut added a commit to tiacsys/bridle that referenced this issue Feb 20, 2023
The actions/github-script was recently updated from v3.1.0 to v6
to catch Node 16 (f49acac), but
unfortunately there were breaking changes in the API with v5:

* https://github.com/actions/github-script#breaking-changes-in-v5
* actions/github-script#242 (comment)

Error was manifest as:

TypeError: Cannot read properties of undefined
           (reading 'listWorkflowRunArtifacts')

So update our code to to use the new way to do things.

issues: #62 #64

Signed-off-by: Stephan Linz <[email protected]>
rexut added a commit to tiacsys/bridle that referenced this issue Feb 20, 2023
The actions/github-script was recently updated from v3.1.0 to v6
to catch Node 16 (f49acac), but
unfortunately there were breaking changes in the API with v5:

* https://github.com/actions/github-script#breaking-changes-in-v5
* actions/github-script#242 (comment)

Error was manifest as:

TypeError: Cannot read properties of undefined
           (reading 'listWorkflowRunArtifacts')

So update our code to to use the new way to do things.

issues: #62 #64

Signed-off-by: Stephan Linz <[email protected]>
bpedersen2 added a commit to SciCatProject/frontend that referenced this issue Jan 19, 2024
Junjiequan pushed a commit to SciCatProject/frontend that referenced this issue Jan 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question A question on how to use this action
Projects
None yet
Development

No branches or pull requests

2 participants