From 3ec6cf5e7b3f9bd06aa32121669592be33a4091d Mon Sep 17 00:00:00 2001 From: Pigbibi <20649888+Pigbibi@users.noreply.github.com> Date: Thu, 18 Jun 2026 18:34:28 +0800 Subject: [PATCH] Make LongBridge manual invoke default to precheck --- .github/workflows/invoke-cloud-run.yml | 11 ++++++++++- tests/test_invoke_cloud_run_workflow.sh | 3 +++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/invoke-cloud-run.yml b/.github/workflows/invoke-cloud-run.yml index b497ca6..4aed35b 100644 --- a/.github/workflows/invoke-cloud-run.yml +++ b/.github/workflows/invoke-cloud-run.yml @@ -15,8 +15,13 @@ on: path: description: "HTTP path to call" required: false - default: "/" + default: "/precheck" type: string + allow_live_execution: + description: "Allow calling / live execution entrypoint" + required: false + default: false + type: boolean env: GCP_PROJECT_ID: longbridgequant @@ -82,6 +87,10 @@ jobs: if [[ "${raw_path}" != /* ]]; then raw_path="/${raw_path}" fi + if [ "${raw_path}" = "/" ] && [ "${{ inputs.allow_live_execution }}" != "true" ]; then + echo "Calling / can trigger the live execution entrypoint. Re-run with allow_live_execution=true if this is intentional." >&2 + exit 1 + fi service_json="$( gcloud run services describe "${CLOUD_RUN_SERVICE}" \ diff --git a/tests/test_invoke_cloud_run_workflow.sh b/tests/test_invoke_cloud_run_workflow.sh index 4902758..5d6ed8a 100644 --- a/tests/test_invoke_cloud_run_workflow.sh +++ b/tests/test_invoke_cloud_run_workflow.sh @@ -7,6 +7,9 @@ workflow_file="$repo_dir/.github/workflows/invoke-cloud-run.yml" grep -Fq "name: Invoke Cloud Run" "$workflow_file" grep -Fq "workflow_dispatch:" "$workflow_file" grep -Fq "environment: \${{ inputs.environment }}" "$workflow_file" +grep -Fq 'default: "/precheck"' "$workflow_file" +grep -Fq "allow_live_execution:" "$workflow_file" +grep -Fq "Calling / can trigger the live execution entrypoint." "$workflow_file" grep -Fq "id-token: write" "$workflow_file" grep -Fq "google-github-actions/auth@v3" "$workflow_file" grep -Fq "google-github-actions/setup-gcloud@v3" "$workflow_file"