Skip to content

Commit

Permalink
Update assign-milestone-on-close.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
SaschaCowley authored Aug 19, 2024
1 parent ec7ef16 commit 4b2fe2a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .github/workflows/assign-milestone-on-close.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ jobs:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const issueOrPr = context.payload.issue || context.payload.pull_request;
if ((context.payload.issue.state_reason === "completed") || (context.payload.pull_request.merged)) {
if (
(context.payload.issue && context.payload.issue.state_reason === "completed")
|| (context.payload.pull_request && context.payload.pull_request.merged)
) {
core.setOutput('isDone', 'true');
} else {
core.setOutput('isDone', 'false');
Expand Down

0 comments on commit 4b2fe2a

Please sign in to comment.