diff --git a/dist/index.js b/dist/index.js index 00db069..2c764f7 100644 --- a/dist/index.js +++ b/dist/index.js @@ -191,7 +191,7 @@ exports.createDeployment = async function(applicationName, fullRepositoryName, b const fullRepositoryName = payload.repository.full_name; // like "Codertocat/Hello-World" const isPullRequest = payload.pull_request !== undefined; - const commitId = isPullRequest ? payload.pull_request.head.sha : payload.head_commit.id; // like "ec26c3e57ca3a959ca5aad62de7213c562f8c821" + const commitId = isPullRequest ? payload.pull_request.head.sha : (payload.head_commit ? payload.head_commit.id : github.context.sha); // like "ec26c3e57ca3a959ca5aad62de7213c562f8c821" const branchName = isPullRequest ? payload.pull_request.head.ref : payload.ref.replace(/^refs\/heads\//, ''); // like "my/branch_name" const skipSequenceCheck = core.getBooleanInput('skip-sequence-check'); diff --git a/index.js b/index.js index 88cd46b..d8040d3 100644 --- a/index.js +++ b/index.js @@ -10,7 +10,7 @@ const fullRepositoryName = payload.repository.full_name; // like "Codertocat/Hello-World" const isPullRequest = payload.pull_request !== undefined; - const commitId = isPullRequest ? payload.pull_request.head.sha : payload.head_commit.id; // like "ec26c3e57ca3a959ca5aad62de7213c562f8c821" + const commitId = isPullRequest ? payload.pull_request.head.sha : (payload.head_commit ? payload.head_commit.id : github.context.sha); // like "ec26c3e57ca3a959ca5aad62de7213c562f8c821" const branchName = isPullRequest ? payload.pull_request.head.ref : payload.ref.replace(/^refs\/heads\//, ''); // like "my/branch_name" const skipSequenceCheck = core.getBooleanInput('skip-sequence-check');