File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2828 options :
2929 - keepalive
3030 - full
31+ allow_vm_reset :
32+ description : permit automatic VM reset after SSH/SCP/deploy failure
33+ required : false
34+ default : false
35+ type : boolean
3136 sync_github_secrets_to_secret_manager :
3237 description : write current GitHub secrets into Secret Manager before deploy
3338 required : false
@@ -223,6 +228,7 @@ jobs:
223228 VNC_SERVER_PASSWORD_SECRET_NAME : ${{ matrix.target.vnc_server_password_secret_name }}
224229 WORKFLOW_DISPATCH_MODE : ${{ github.event.inputs.deploy_mode }}
225230 WORKFLOW_DISPATCH_TARGET : ${{ github.event.inputs.target }}
231+ WORKFLOW_DISPATCH_ALLOW_VM_RESET : ${{ github.event.inputs.allow_vm_reset }}
226232 steps :
227233 - name : Checkout code
228234 uses : actions/checkout@v6
@@ -511,6 +517,12 @@ jobs:
511517 )
512518
513519 reset_instance_and_wait_for_ssh() {
520+ if [ "${DEPLOY_EVENT_NAME}" = "workflow_dispatch" ] \
521+ && [ "${WORKFLOW_DISPATCH_ALLOW_VM_RESET:-false}" != "true" ]; then
522+ echo "Manual workflow VM reset is disabled; failing closed." >&2
523+ return 1
524+ fi
525+
514526 log_step "Resetting ${GCE_INSTANCE_NAME} after SSH/SCP failure"
515527 gcloud compute instances reset "${GCE_INSTANCE_NAME}" \
516528 --project "${GCP_PROJECT_ID}" \
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ grep -Fq 'workload_identity_provider: ${{ env.GCP_WORKLOAD_IDENTITY_PROVIDER }}'
2121grep -Fq ' service_account: ${{ env.GCP_WORKLOAD_IDENTITY_SERVICE_ACCOUNT }}' " $workflow_file "
2222grep -Fq " DEPLOY_EVENT_NAME: \$ {{ github.event_name }}" " $workflow_file "
2323grep -Fq " WORKFLOW_DISPATCH_MODE: \$ {{ github.event.inputs.deploy_mode }}" " $workflow_file "
24+ grep -Fq " WORKFLOW_DISPATCH_ALLOW_VM_RESET: \$ {{ github.event.inputs.allow_vm_reset }}" " $workflow_file "
2425grep -Fq ' vars.IB_GATEWAY_INSTANCE_NAME' " $workflow_file "
2526grep -Fq ' vars.IB_GATEWAY_ZONE' " $workflow_file "
2627grep -Fq ' vars.IB_GATEWAY_MODE' " $workflow_file "
@@ -64,6 +65,7 @@ grep -Fq 'elif [ "${DEPLOY_EVENT_NAME}" = "workflow_dispatch" ]; then' "$workflo
6465grep -Fq ' DEPLOY_MODE="${WORKFLOW_DISPATCH_MODE:-keepalive}"' " $workflow_file "
6566grep -Fq ' Scheduled keepalive mode: skip docker build' " $workflow_file "
6667grep -Fq ' reset_instance_and_wait_for_ssh()' " $workflow_file "
68+ grep -Fq ' Manual workflow VM reset is disabled; failing closed.' " $workflow_file "
6769grep -Fq ' run_remote_ssh()' " $workflow_file "
6870grep -Fq ' copy_remote_file()' " $workflow_file "
6971grep -Fq ' git archive --format=tar.gz' " $workflow_file "
You can’t perform that action at this time.
0 commit comments