Skip to content

Conversation

@CloudNStoyan
Copy link

Currently when there is already a PR created and the action is ran the following error occurs:

Run tgymnich/[email protected]
/home/runner/work/_actions/tgymnich/fork-sync/v2.0/lib/main.js:85
            console.log(error.errors[0].message);
                                    ^

TypeError: Cannot read properties of undefined (reading '0')
    at run (/home/runner/work/_actions/tgymnich/fork-sync/v2.0/lib/main.js:85:37)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Node.js v20.13.1

The problem was this line:

console.log(error.errors[0].message);

Which tries to get the error from the wrong place, which I fixed by just copying the above IF statement's way of extracting the error message

I tested it on my repo and now the action doesn't fail when the PR is already created

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant