Add manual Cloud Run deploy dispatch#97
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9b9aeac35c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| on: | ||
| push: | ||
| branches: [ main ] | ||
| workflow_dispatch: |
There was a problem hiding this comment.
Restrict manual deploys to main
With this bare workflow_dispatch, a maintainer can choose any branch/ref in the manual “Run workflow” UI; this job later checks out that selected ref and deploys the resulting ${GITHUB_SHA} image to the Cloud Run environments. That bypasses the previous push trigger's main-only deployment restriction, so a feature branch can be manually promoted to production unless the workflow gates github.ref == 'refs/heads/main' or otherwise validates the selected ref.
Useful? React with 👍 / 👎.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9b9aeac35c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| on: | ||
| push: | ||
| branches: [ main ] | ||
| workflow_dispatch: |
There was a problem hiding this comment.
Restrict manual deploys to main
With this workflow_dispatch trigger, a repo writer can manually run the workflow against any branch (GitHub documents the Branch dropdown/--ref behavior: https://docs.github.com/en/actions/how-tos/manage-workflow-runs/manually-run-a-workflow). I checked this workflow’s deploy path: it checks out the dispatched ref and then builds/deploys ${GITHUB_SHA} to the configured Cloud Run services, so selecting an unmerged feature branch can deploy non-main code to the paper/HK/SG environments despite the existing push trigger being limited to main; add a job/step guard such as github.ref == 'refs/heads/main' if manual deploys are meant to match the production path.
Useful? React with 👍 / 👎.
Summary\n- allow the Cloud Run deploy workflow to be triggered manually from GitHub Actions\n\n## Validation\n- git diff --check\n- npx --yes prettier@3.3.3 --check .github/workflows/sync-cloud-run-env.yml (existing formatting warnings only)