Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion .github/workflows/invoke-cloud-run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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}" \
Expand Down
3 changes: 3 additions & 0 deletions tests/test_invoke_cloud_run_workflow.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down