fix(deploy): fall back to container SHA discovery when the staging revision state file is unreadable

The staging host currently has .state/deployed-revision unreadable by the
deploy user, so the forward-only revision check failed with 'Permission
denied' before it could compare revisions. Treat an unreadable state file
like a missing one and discover the running revision from the web
container's GITHUB_SHA, in both the workflow step and the server-side
deploy/migration scripts.
This commit is contained in:
Jesse_Chen
2026-08-14 02:11:07 +08:00
parent 192cb5577d
commit cc1d1d3fb3
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -47,7 +47,7 @@ flock -n 9 || {
}
current_sha="not-deployed"
if [ -f "$state_directory/deployed-revision" ]; then
if [ -r "$state_directory/deployed-revision" ]; then
current_sha="$(<"$state_directory/deployed-revision")"
else
existing_web="$("${docker_command[@]}" ps -aq \
+1 -1
View File
@@ -41,7 +41,7 @@ flock -n 9 || {
}
current_sha="not-deployed"
if [ -f "$state_directory/deployed-revision" ]; then
if [ -r "$state_directory/deployed-revision" ]; then
current_sha="$(<"$state_directory/deployed-revision")"
else
existing_web="$("${docker_command[@]}" ps -aq \