Skip to content

Commit

Permalink
Fix gh sha
Browse files Browse the repository at this point in the history
  • Loading branch information
kamranayub committed Jul 6, 2020
1 parent 845ed4f commit abd6598
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ const waitForUrl = async (url, MAX_TIMEOUT) => {
const run = async () => {
try {
const netlifyToken = process.env.NETLIFY_TOKEN;
const commitSha = github.context.sha;
// In a PR, github.contex.sha refers to the last merge commit SHA
// not the *latest commit* of the PR which is what Netlify uses. Instead,
// have to use github.context.event.pull_request.head.sha
// See: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#pull_request
const commitSha = github.context.event.pull_request.head.sha;
const MAX_TIMEOUT = Number(core.getInput("max_timeout")) || 60;
const siteName = core.getInput("site_name");
if (!netlifyToken) {
Expand Down

0 comments on commit abd6598

Please sign in to comment.