Skip to content

Commit 9b5da51

Browse files
committed
safer assignment
1 parent 2cfc156 commit 9b5da51

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -425,8 +425,8 @@ async function run() {
425425
core.debug(`The head commit is: ${commit}`);
426426
}
427427
} else if (context.eventName === 'release') {
428-
const tagName = context.payload.release.tag_name;
429-
ref = `refs/tags/${tagName}`;
428+
const tagName = context.payload.release?.tag_name;
429+
ref = !tagName ? ref : `refs/tags/${tagName}`;
430430
core.debug(`The release ref is: ${ref}`);
431431
}
432432

0 commit comments

Comments
 (0)