Skip to content

Commit

Permalink
More undef checks
Browse files Browse the repository at this point in the history
  • Loading branch information
terryknowlton committed Dec 5, 2024
1 parent bbe08ac commit ec6e351
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ async function populatePullRequestEventCommitDetails(pullRequestEvent, context)
repo: context.repo.repo,
ref: head?.sha,
});
setVariable(environmentVariables_1.EnvironmentVariables.CI_COMMIT_MESSAGE, response.data.commit.message);
setVariable(environmentVariables_1.EnvironmentVariables.CI_COMMIT_MESSAGE, response.data?.commit?.message);
}
else {
core.warning('Unable to get commit message for PR. Missing github-token input.');
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ async function populatePullRequestEventCommitDetails(

setVariable(
EnvironmentVariables.CI_COMMIT_MESSAGE,
response.data.commit.message,
response.data?.commit?.message,
);
} else {
core.warning(
Expand Down

0 comments on commit ec6e351

Please sign in to comment.