Fix CI not attaching a "View deployment" button in PRs for build links

This commit is contained in:
Keavon Chambers
2026-04-23 02:29:20 -07:00
parent d3f36a95cf
commit e2117d9a02
2 changed files with 13 additions and 10 deletions
+12 -9
View File
@@ -157,18 +157,21 @@ jobs:
REF="master" REF="master"
ENVIRONMENT="graphite-dev (Production)" ENVIRONMENT="graphite-dev (Production)"
else else
REF="$(git rev-parse HEAD)" REF="${{ inputs.checkout_ref || github.head_ref || github.ref_name }}"
ENVIRONMENT="graphite-dev (Preview)" ENVIRONMENT="graphite-dev (Preview)"
fi fi
DEPLOY_ID=$(gh api \ create_deployment() {
-X POST \ gh api \
-H "Accept: application/vnd.github+json" \ -X POST \
repos/${{ github.repository }}/deployments \ -H "Accept: application/vnd.github+json" \
--input - \ repos/${{ github.repository }}/deployments \
--jq '.id' <<EOF --input - \
{"ref":"$REF","environment":"$ENVIRONMENT","auto_merge":false,"required_contexts":[]} --jq '.id' <<EOF
{"ref":"$1","environment":"$ENVIRONMENT","auto_merge":false,"required_contexts":[]}
EOF EOF
) }
# Try branch name first (needed for GitHub's PR "View deployment" button), fall back to commit SHA if the branch was deleted
DEPLOY_ID=$(create_deployment "$REF" 2>/dev/null) || DEPLOY_ID=$(create_deployment "$(git rev-parse HEAD)")
gh api \ gh api \
-X POST \ -X POST \
-H "Accept: application/vnd.github+json" \ -H "Accept: application/vnd.github+json" \
@@ -33,7 +33,7 @@
{#if $tooltip.visible} {#if $tooltip.visible}
<Tooltip /> <Tooltip />
{/if} {/if}
{#if import.meta.env.MODE === "native" && new Date() > new Date("2026-04-30")} {#if import.meta.env.MODE === "native" && new Date() > new Date("2026-07-01")}
<LayoutCol class="release-candidate-expiry"> <LayoutCol class="release-candidate-expiry">
<TextLabel> <TextLabel>
<p> <p>