Skip to content

Conversation

thehabbos007
Copy link

@thehabbos007 thehabbos007 commented Nov 9, 2021

When a PR branch is deleted the repository.pullRequest.headRefs is null. This change is aware of that.
Currently the following error happens if the action is used on a PR with a deleted branch (closed or merged):

Error: Cannot read property 'name' of null
(node:1474) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'name' of null
    at pullRequestDetails (/home/runner/work/_actions/storyai/pull-request-comment-branch/v1/webpack:/pull-request-comment-branch/src/PullRequests.ts:38:1)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at run (/home/runner/work/_actions/storyai/pull-request-comment-branch/v1/webpack:/pull-request-comment-branch/src/main.ts:9:1)

It is understandable if it is not desirable to have null refs in steps, though :)

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.

2 participants