diff --git a/index.js b/index.js index d748bf37..72d0a32c 100644 --- a/index.js +++ b/index.js @@ -29,9 +29,9 @@ const run = async () => { const netlifyToken = process.env.NETLIFY_TOKEN; // 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 + // have to use github.context.payload.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 commitSha = github.context.payload.pull_request.head.sha; const MAX_TIMEOUT = Number(core.getInput("max_timeout")) || 60; const siteName = core.getInput("site_name"); if (!netlifyToken) {