diff --git a/src/main.ts b/src/main.ts index 2c99bd28..134b52ca 100644 --- a/src/main.ts +++ b/src/main.ts @@ -45,13 +45,13 @@ async function createGitHubDeployment( environment: string, description: string | undefined ): Promise { - const {ref} = context + const deployRef = context.payload.pull_request?.head.sha ?? context.sha const deployment = await githubClient.repos.createDeployment({ // eslint-disable-next-line @typescript-eslint/camelcase auto_merge: false, owner: context.repo.owner, repo: context.repo.repo, - ref, + ref: deployRef, environment, description, // eslint-disable-next-line @typescript-eslint/camelcase