This repository was archived by the owner on Mar 27, 2025. It is now read-only.
generated from actions/typescript-action
-
Notifications
You must be signed in to change notification settings - Fork 61
Cannot destructure property login
of 'undefined' or 'null'.
#24
Comments
Seeing the same. |
same issue |
Yeah, same. Here's a publicly available GitHub Actions run with the error: {
error: TypeError: Cannot destructure property `login` of 'undefined' or 'null'.
at /home/runner/work/_actions/cleartax/jira-lint/master/lib/index.js:1:21210
at Generator.next (<anonymous>)
at /home/runner/work/_actions/cleartax/jira-lint/master/lib/index.js:1:19906
at new Promise (<anonymous>)
at n (/home/runner/work/_actions/cleartax/jira-lint/master/lib/index.js:1:19654)
at run (/home/runner/work/_actions/cleartax/jira-lint/master/lib/index.js:1:20939)
at Object.131 (/home/runner/work/_actions/cleartax/jira-lint/master/lib/index.js:1:23551)
at __webpack_require__ (/home/runner/work/_actions/cleartax/jira-lint/master/lib/index.js:1:154)
at startup (/home/runner/work/_actions/cleartax/jira-lint/master/lib/index.js:1:291)
at module.exports.0 (/home/runner/work/_actions/cleartax/jira-lint/master/lib/index.js:1:323)
}
Error: Cannot destructure property `login` of 'undefined' or 'null'. |
It would be a lot easier to debug this problem if a non-minimized version of the action was provided, somehow. If one can be provided (in a separate branch, for instance), I can run against it and give you a new and much more informative stack trace. But it seems like this is the problematic (minimized) expression: const{payload:{repository:f,organization:{login:y},pull_request:b}}=o.context If that's correct, this may be the source: Lines 64 to 70 in 0b90e54
|
I'm not sure, but I believe that this would fix the problem: diff --git a/src/main.ts b/src/main.ts
index 10d28e9..4b55e79 100755
--- a/src/main.ts
+++ b/src/main.ts
@@ -64,7 +64,6 @@ async function run(): Promise<void> {
const {
payload: {
repository,
- organization: { login: owner },
pull_request: pullRequest,
},
} = github.context;
@@ -73,7 +72,7 @@ async function run(): Promise<void> {
throw new Error(`Missing 'repository' from github action context.`);
}
- const { name: repo } = repository;
+ const { name: repo, owner: { login: owner } } = repository;
const {
base: { ref: baseBranch }, |
I submitted #55 to fix this problem. |
As suggested by @maddhruv in #56 (comment), I've forked and fixed this and a lot of other issues in |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The text was updated successfully, but these errors were encountered: