Skip to content

Commit 536b870

Browse files
committed
Get default sha from github.context
1 parent 578dbd2 commit 536b870

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

dist/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ exports.createDeployment = async function(applicationName, fullRepositoryName, b
191191
const fullRepositoryName = payload.repository.full_name; // like "Codertocat/Hello-World"
192192

193193
const isPullRequest = payload.pull_request !== undefined;
194-
const commitId = isPullRequest ? payload.pull_request.head.sha : (payload.head_commit ? payload.head_commit.id : github.sha); // like "ec26c3e57ca3a959ca5aad62de7213c562f8c821"
194+
const commitId = isPullRequest ? payload.pull_request.head.sha : (payload.head_commit ? payload.head_commit.id : github.context.sha); // like "ec26c3e57ca3a959ca5aad62de7213c562f8c821"
195195
const branchName = isPullRequest ? payload.pull_request.head.ref : payload.ref.replace(/^refs\/heads\//, ''); // like "my/branch_name"
196196
console.log(`🎋 On branch '${branchName}', head commit ${commitId}`);
197197

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
const fullRepositoryName = payload.repository.full_name; // like "Codertocat/Hello-World"
1111

1212
const isPullRequest = payload.pull_request !== undefined;
13-
const commitId = isPullRequest ? payload.pull_request.head.sha : (payload.head_commit ? payload.head_commit.id : github.sha); // like "ec26c3e57ca3a959ca5aad62de7213c562f8c821"
13+
const commitId = isPullRequest ? payload.pull_request.head.sha : (payload.head_commit ? payload.head_commit.id : github.context.sha); // like "ec26c3e57ca3a959ca5aad62de7213c562f8c821"
1414
const branchName = isPullRequest ? payload.pull_request.head.ref : payload.ref.replace(/^refs\/heads\//, ''); // like "my/branch_name"
1515
console.log(`🎋 On branch '${branchName}', head commit ${commitId}`);
1616

0 commit comments

Comments
 (0)