fix: keep staging deployment dispatch isolated
Deploy staging to test server / deploy (push) Successful in 2m32s

This commit is contained in:
linmeng
2026-07-30 11:32:35 +08:00
parent 772c06c205
commit 4a6d9168c7
2 changed files with 3 additions and 3 deletions
@@ -210,7 +210,7 @@ jobs:
exit 1 exit 1
} }
payload="$(jq -cn --arg deploy_sha "$DEPLOY_SHA" \ payload="$(jq -cn --arg deploy_sha "$DEPLOY_SHA" \
'{ref:"main",inputs:{deploy_sha:$deploy_sha,allow_rollback:"false"}}')" '{ref:"staging",inputs:{deploy_sha:$deploy_sha,allow_rollback:"false"}}')"
curl --fail --silent --show-error --request POST \ curl --fail --silent --show-error --request POST \
--header "Authorization: Bearer $GH_TOKEN" \ --header "Authorization: Bearer $GH_TOKEN" \
--header "Accept: application/vnd.github+json" \ --header "Accept: application/vnd.github+json" \
@@ -205,7 +205,7 @@ test("staging owns its deployment control plane independently from main", () =>
for (const workflow of [read(deployWorkflow), read(migrationWorkflow)]) { for (const workflow of [read(deployWorkflow), read(migrationWorkflow)]) {
assert.match(workflow, /name: Checkout staging controller[\s\S]*ref: staging/); assert.match(workflow, /name: Checkout staging controller[\s\S]*ref: staging/);
assert.match(workflow, /fetch-depth: 0/); assert.match(workflow, /fetch-depth: 0/);
assert.doesNotMatch(workflow, /ref: main/); assert.doesNotMatch(workflow, /ref:\s*"?main"?/);
assert.doesNotMatch(workflow, /reviewed main history/); assert.doesNotMatch(workflow, /reviewed main history/);
assert.match(workflow, /--include='\/deploy\/' --include='\/deploy\/\*\*\*' --exclude='\*'/); assert.match(workflow, /--include='\/deploy\/' --include='\/deploy\/\*\*\*' --exclude='\*'/);
assert.doesNotMatch(workflow, /ref: \$\{\{ steps\.revision\.outputs\.sha \}\}/); assert.doesNotMatch(workflow, /ref: \$\{\{ steps\.revision\.outputs\.sha \}\}/);
@@ -251,7 +251,7 @@ test("automatic staging paths reject stale and divergent revisions", () => {
assert.match(deployment, /\.status == "ahead" and \.merge_base_commit\.sha == \$base/); assert.match(deployment, /\.status == "ahead" and \.merge_base_commit\.sha == \$base/);
assert.match(migration, /stale staging migration refused/); assert.match(migration, /stale staging migration refused/);
assert.match(migration, /staging advanced during migration; refusing stale deployment dispatch/); assert.match(migration, /staging advanced during migration; refusing stale deployment dispatch/);
assert.match(migration, /\{ref:"main",inputs:\{deploy_sha:\$deploy_sha,allow_rollback:"false"\}\}/); assert.match(migration, /\{ref:"staging",inputs:\{deploy_sha:\$deploy_sha,allow_rollback:"false"\}\}/);
}); });
test("remote deployment verifies running image IDs, RepoDigests, and application SHA", () => { test("remote deployment verifies running image IDs, RepoDigests, and application SHA", () => {