Added deployment trigger#85
Conversation
Added deployment trigger to deploy to Azure Static Webapps
📝 WalkthroughWalkthroughThe deployment workflow now uses ChangesAzure deployment automation
Sequence Diagram(s)sequenceDiagram
participant PullRequest
participant GitHubActions
participant DeployToAzure
participant AzureStaticWebApps
PullRequest->>GitHubActions: merge PR into supported branch
GitHubActions->>DeployToAzure: dispatch workflow with base branch
DeployToAzure->>AzureStaticWebApps: deploy with production_branch
Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
.github/workflows/deploy-to-azure.yml (1)
8-13: 🗄️ Data Integrity & Integration | 🔴 Critical | ⚡ Quick winFix the
environmentoptions list to includedevelopinstead ofdevelopment.The default value
develop(line 8) is not in theoptionslist, which still containsdevelopment(line 13). Additionally, the case statement (line 27) now handlesdevelopbut no longer handlesdevelopment. If someone manually dispatches this workflow and selectsdevelopmentfrom the dropdown, the case statement won't match any branch, leavingtarget_envunset and breaking the downstreamenvironmentoutput.This also creates a cross-file contract mismatch:
trigger-deploy-on-merge.ymlpassesenvironment=developviagh workflow run, which bypasses the UI choice constraint but is inconsistent with the declared options.🔧 Proposed fix: replace `development` with `develop` in options
options: - production - staging - - development + - develop - testingAlso applies to: 27-27
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/deploy-to-azure.yml around lines 8 - 13, Replace the `development` entry in the workflow’s `environment` choice options with `develop` so it matches the default and the value handled by the case statement. Verify the `environment` input and `target_env` mapping consistently use `develop` across the workflow.Source: Linters/SAST tools
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/trigger-deploy-on-merge.yml:
- Around line 4-5: Add a job-level condition to the workflow job triggered by
the pull_request closed event, requiring github.event.pull_request.merged ==
true; apply the same guard to the corresponding deployment job block so unmerged
PR closures cannot dispatch deployments.
---
Outside diff comments:
In @.github/workflows/deploy-to-azure.yml:
- Around line 8-13: Replace the `development` entry in the workflow’s
`environment` choice options with `develop` so it matches the default and the
value handled by the case statement. Verify the `environment` input and
`target_env` mapping consistently use `develop` across the workflow.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: cb76b404-4cb6-4960-9a0b-104a55e5889f
📒 Files selected for processing (2)
.github/workflows/deploy-to-azure.yml.github/workflows/trigger-deploy-on-merge.yml
| types: [closed] | ||
| branches: [develop, staging, production, testing] |
There was a problem hiding this comment.
🩺 Stability & Availability | 🔴 Critical | ⚡ Quick win
Guard the job to only run when the pull request was actually merged.
types: [closed] fires for both merged and unmerged PRs. Without an if condition, closing a PR without merging would dispatch a deployment, potentially deploying rejected code. Add a job-level merged check.
🔒 Proposed fix: add merged check to the job
jobs:
deploy-frontend:
+ if: github.event.pull_request.merged == true
runs-on: ubuntu-latestAlso applies to: 11-12
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.github/workflows/trigger-deploy-on-merge.yml around lines 4 - 5, Add a
job-level condition to the workflow job triggered by the pull_request closed
event, requiring github.event.pull_request.merged == true; apply the same guard
to the corresponding deployment job block so unmerged PR closures cannot
dispatch deployments.
Added deployment trigger to deploy to Azure Static Webapps
This pull request introduces updates to the deployment workflows, mainly to improve consistency in environment naming and to automate deployments upon pull request merges. The most important changes are grouped below:
Workflow Automation:
.github/workflows/trigger-deploy-on-merge.ymlthat triggers the deployment process automatically when a pull request is merged into one of the main branches (develop,staging,production, ortesting).Environment Naming Consistency:
.github/workflows/deploy-to-azure.ymlfromdevelopmenttodevelopto match branch naming conventions.developinstead ofdevelopment.Deployment Parameter Improvements:
production_branchto the deploy-to-azure workflow, set to the selected environment.Summary
develop,staging,production, ortesting.developmenttodevelopand updated its mapping.production_branchconfiguration using the selected deployment environment.