Repository navigation
Replace Azure Static Web App action with az + swa CLI - #3692
Conversation
Preview deployment should not depend on the stale Azure action release or a deployment token stored in GitHub. An isolated preview identity keeps deployment access separate from package-signing permissions. Artifact-provided CLI configuration must not be able to redirect uploads to privileged runner files.
These deployments are PR previews, not staging sites. Keep recognizing the old wording so redeployments do not leave duplicate bot comments.
Keep Azure resource selection with the isolated environment's identity settings instead of hardcoding it in both workflows. Missing settings must fail before deployment or cleanup.
Azure's delete command polls a subscription-scoped operation endpoint that the preview identity cannot read. Confirm deletion through the resource-scoped environment list without broadening its permissions.
The SWA CLI searches configuration directories recursively, so a nested fixture can override the intended root configuration. Isolate that root file before passing its directory to the deployment client.
There was a problem hiding this comment.
🟡 Changes recommended
The unconditional configuration-file copy fails because the Gatsby artifact lacks staticwebapp.config.json, aborting normal preview deployments before swa runs.
1 open issue
What changed in this PR
Replaces the Azure Static Web Apps action with Azure and SWA CLI commands, using OIDC authentication instead of a stored deployment token and avoiding the action’s preview-input warnings.
Changes:
- Deploys PR previews through the SWA CLI and retrieves their URLs from Azure.
- Deletes closed PR previews through Azure, with polling to confirm removal.
- Updates preview comment wording while retaining cleanup of legacy comments.
| File | Description |
|---|---|
.github/workflows/deploy-preview.yml |
Adds OIDC login, CLI deployment, URL lookup, and updated preview comments. |
.github/workflows/close-preview.yml |
Adds OIDC login and Azure-based preview deletion with completion polling. |
Review effort: Balanced
Normal Gatsby builds do not include staticwebapp.config.json. Treat its absence as an empty configuration while keeping nested artifact files out of runtime configuration discovery.
There was a problem hiding this comment.
🔵 Needs a closer look
A maintainer should validate deployment and deletion with the configured Azure identity because the required environment variables, OIDC federation, and RBAC grants cannot be verified from the diff.
No open issues 🎉
1 resolved since last review
Review effort: Balanced
|
Where do these shell scripts come from? |
|
They're not from anywhere, copilot produced but they're just doing the cli version of the action, more or less. |

This allows us to get rid of a copied token in favor of OIDC, and has the side benefit of eliminating the problem that led to #3691.