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

Support deleted PR branch #202

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

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