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

This commit is contained in:
Keavon Chambers 2026-04-22 16:00:38 -07:00
parent d3f36a95cf
commit e2117d9a02
2 changed files with 13 additions and 10 deletions

View File

@ -157,18 +157,21 @@ jobs:
REF="master"
ENVIRONMENT="graphite-dev (Production)"
else
REF="$(git rev-parse HEAD)"
REF="${{ inputs.checkout_ref || github.head_ref || github.ref_name }}"
ENVIRONMENT="graphite-dev (Preview)"
fi
DEPLOY_ID=$(gh api \
-X POST \
-H "Accept: application/vnd.github+json" \
repos/${{ github.repository }}/deployments \
--input - \
--jq '.id' <<EOF
{"ref":"$REF","environment":"$ENVIRONMENT","auto_merge":false,"required_contexts":[]}
create_deployment() {
gh api \
-X POST \
-H "Accept: application/vnd.github+json" \
repos/${{ github.repository }}/deployments \
--input - \
--jq '.id' <<EOF
{"ref":"$1","environment":"$ENVIRONMENT","auto_merge":false,"required_contexts":[]}
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 \
-X POST \
-H "Accept: application/vnd.github+json" \

View File

@ -33,7 +33,7 @@
{#if $tooltip.visible}
<Tooltip />
{/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">
<TextLabel>
<p>