fix: use Gitea staging run identifier
Deploy staging to test server / deploy (push) Successful in 2m33s

Build staging mutation paths from the runner-provided run ID so migration and deployment do not fail under strict shell variables.
This commit is contained in:
linmeng
2026-07-30 11:00:05 +08:00
parent d3cc70737d
commit 06e4b9d003
3 changed files with 9 additions and 2 deletions
+1 -1
View File
@@ -83,7 +83,7 @@ jobs:
ssh_root="${RUNNER_TEMP}/staging-ssh"
key_path="$ssh_root/id_ed25519"
known_hosts_path="$ssh_root/known_hosts"
incoming="$DEPLOY_PATH/.incoming/$GITEA_RUN_NUMBER-$GITEA_RUN_ATTEMPT"
incoming="$DEPLOY_PATH/.incoming/${GITEA_RUN_ID:?}-${GITEA_RUN_ATTEMPT:-1}"
install -m 700 -d "$ssh_root"
printf '%s\n' "$SSH_PRIVATE_KEY" | tr -d '\r' > "$key_path"
printf '%s\n' "$STAGING_KNOWN_HOSTS" | tr -d '\r' > "$known_hosts_path"
@@ -69,7 +69,7 @@ jobs:
ssh_root="${RUNNER_TEMP}/staging-migration-ssh"
key_path="$ssh_root/id_ed25519"
known_hosts_path="$ssh_root/known_hosts"
incoming="$DEPLOY_PATH/.incoming/$GITEA_RUN_NUMBER-$GITEA_RUN_ATTEMPT"
incoming="$DEPLOY_PATH/.incoming/${GITEA_RUN_ID:?}-${GITEA_RUN_ATTEMPT:-1}"
install -m 700 -d "$ssh_root"
printf '%s\n' "$SSH_PRIVATE_KEY" | tr -d '\r' > "$key_path"
printf '%s\n' "$STAGING_KNOWN_HOSTS" | tr -d '\r' > "$known_hosts_path"
@@ -220,6 +220,13 @@ test("Gitea staging digest resolution selects linux amd64 from manifest arrays",
}
});
test("Gitea staging mutations use available run identifiers", () => {
for (const workflow of [read(giteaDeployWorkflow), read(giteaMigrationWorkflow)]) {
assert.match(workflow, /\$\{GITEA_RUN_ID:\?\}-\$\{GITEA_RUN_ATTEMPT:-1\}/);
assert.doesNotMatch(workflow, /GITEA_RUN_NUMBER/);
}
});
test("staging mutations retain every pending deployment and migration", () => {
for (const workflow of [read(deployWorkflow), read(migrationWorkflow)]) {
assert.match(