Skip to content

Commit f90face

Browse files
committed
ci(deploy): drop the PR-provenance gate
Deploy shipped only commits that landed through a pull request — the gate failed raw direct pushes to main as unvalidated. The validation argument belongs to branch protection, not a workflow step: the tip guard already prevents racing deploys, and direct pushes of chores and test changes were turning main red for no safety gain. The force input existed only to bypass the gate; it goes too.
1 parent 777d9e7 commit f90face

1 file changed

Lines changed: 5 additions & 42 deletions

File tree

‎.github/workflows/deploy.yml‎

Lines changed: 5 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,7 @@
77
# smoke (--smoke) → Railway.
88
#
99
# Triggers directly on push to main and re-verifies, per run: the commit is
10-
# still the main tip, the merged diff is runtime-relevant, and the commit
11-
# actually landed as a pull request (the sanctioned merge path — a raw
12-
# direct push has no associated pull request and fails the gate; dispatch
13-
# with the `force` input to deploy deliberately).
10+
# still the main tip and the merged diff is runtime-relevant.
1411
name: Deploy
1512

1613
on:
@@ -22,10 +19,6 @@ on:
2219
description: 'Show full build output instead of clean summary'
2320
type: boolean
2421
default: false
25-
force:
26-
description: 'Skip the merge-queue provenance check (deliberate deploys from main pushes)'
27-
type: boolean
28-
default: false
2922

3023
concurrency:
3124
group: ${{ github.workflow }}-${{ github.ref }}
@@ -37,12 +30,9 @@ permissions:
3730
packages: write
3831

3932
jobs:
40-
# Deploy gate: only while the validated commit is still the tip of main,
41-
# only when the merged diff touches runtime-relevant paths, and only
42-
# when the commit actually landed as a pull request (the sanctioned merge
43-
# path — a raw direct push has no associated PR and fails the gate).
44-
# Manual dispatches must run against main; `force` skips the provenance
45-
# check for deliberate deploys from direct pushes.
33+
# Deploy gate: only while the commit is still the tip of main, and only
34+
# when the merged diff touches runtime-relevant paths. Manual dispatches
35+
# must run against main.
4636
gate:
4737
name: Verify deploy is current
4838
if: >-
@@ -51,7 +41,7 @@ jobs:
5141
runs-on: ubuntu-24.04
5242
timeout-minutes: 5
5343
outputs:
54-
deploy: ${{ steps.tip.outputs.current == 'true' && steps.relevance.outputs.relevant == 'true' && steps.provenance.outputs.queued == 'true' }}
44+
deploy: ${{ steps.tip.outputs.current == 'true' && steps.relevance.outputs.relevant == 'true' }}
5545
steps:
5646
- name: Checkout code
5747
uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0 (Node 24)
@@ -104,33 +94,6 @@ jobs:
10494
while IFS= read -r f; do echo " $f"; done <<< "$FILES"
10595
fi
10696
107-
# Merge-queue provenance: every sanctioned merge to main lands as a
108-
# pull request whose squash commit is this SHA (the "list pull
109-
# requests associated with a commit" endpoint resolves squash merges
110-
# and merge commits alike). A zero result means the commit was pushed
111-
# directly — outside the sanctioned merge path — so it was never
112-
# validated; fail loud instead of deploying unvalidated code.
113-
# workflow_dispatch + `force` is the deliberate escape hatch.
114-
- name: Verify the commit merged through a pull request
115-
id: provenance
116-
env:
117-
GH_TOKEN: ${{ github.token }}
118-
FORCE: ${{ github.event_name == 'workflow_dispatch' && inputs.force == true }}
119-
run: |
120-
QUEUES="$(gh api "repos/$GITHUB_REPOSITORY/commits/$GITHUB_SHA/pulls" --jq length)"
121-
if [ "$QUEUES" -gt 0 ]; then
122-
echo "queued=true" >> "$GITHUB_OUTPUT"
123-
exit 0
124-
fi
125-
if [ "$FORCE" = "true" ]; then
126-
echo "queued=true" >> "$GITHUB_OUTPUT"
127-
echo "::notice::Provenance check skipped by the force input — deploying a commit with no associated pull request"
128-
exit 0
129-
fi
130-
echo "queued=false" >> "$GITHUB_OUTPUT"
131-
echo "::error::$GITHUB_SHA has no associated pull request — it was pushed directly to main, outside the merge queue, so it was never validated. Merging this commit's branch through the queue re-deploys it automatically, or dispatch this workflow on main with the force input to deploy it deliberately."
132-
exit 1
133-
13497
# Image leg: build the `runtime` stage and push it to GHCR (sha-<short> +
13598
# version tags, latest held on prereleases) BEFORE any config/bundle publish,
13699
# so a failed image push cannot leave a partially published deploy. The

0 commit comments

Comments
 (0)