From f7308753d7220f727d5671c7a76c7706190beeb9 Mon Sep 17 00:00:00 2001 From: Noj Vek Date: Mon, 26 Apr 2021 19:58:01 -0700 Subject: [PATCH] Make deployment link on pull request if CI is running on pull request This action has a bug where the deployment link doesn't show on pull request. --- src/main.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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