Skip to content

Deploy staged previews after validation#415

Merged
Gonza10V merged 2 commits into
platform_updatefrom
agent/deploy-after-validation
Jul 17, 2026
Merged

Deploy staged previews after validation#415
Gonza10V merged 2 commits into
platform_updatefrom
agent/deploy-after-validation

Conversation

@Gonza10V

Copy link
Copy Markdown
Contributor

What changed

  • Run the Azure Static Web Apps staged deployment for an active pull request only after Validate Pull Request succeeds.
  • Preserve the existing production deployment on pushes to master.
  • Grant pull-requests: write and pass GITHUB_TOKEN so Azure Static Web Apps can publish the preview URL on the pull request.

Why

PR #413 currently runs validation successfully but skips Build and Deploy Job, so no staged preview is created.

Validation

  • Reviewed the workflow job conditions and dependency graph.
  • The staged deploy is gated by needs.validate_pull_request_job.result == 'success'.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e4a93763c7

ℹ️ 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".

Comment on lines +65 to +69
(github.event_name == 'push' ||
(github.event_name == 'pull_request' &&
github.event.action != 'closed' &&
github.event.pull_request.draft == false &&
needs.validate_pull_request_job.result == 'success'))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Skip preview deployments for forked pull requests

For a pull request opened from a fork, this condition still starts build_and_deploy_job after validation, but GitHub does not expose repository secrets to fork-triggered pull_request workflows. Consequently AZURE_STATIC_WEB_APPS_API_TOKEN_WITTY_HILL_08172A210 resolves to an empty value and the required Azure deployment action fails, turning otherwise valid external-contributor PRs into failed checks. Restrict this deploy path to same-repository heads (or use a separate, safely designed preview workflow).

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@codex good catch, Restrict this deploy path to same-repository heads

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

  • Restricted the staged Azure Static Web Apps deployment job to pull requests whose head repository matches the current repository, preventing forked PRs from attempting a secret-dependent deployment while preserving validation and same-repository previews. .github/workflows/azure-static-web-apps-witty-hill-08172a210.ymlL61-L70
  • Committed the follow-up change as d2e7900 (Skip preview deployments for forked pull requests).
  • Created a follow-up PR titled “Skip staged preview deployments from forked PRs.”

Testing

  • git diff --check
  • ruby -e "require 'yaml'; YAML.load_file('.github/workflows/azure-static-web-apps-witty-hill-08172a210.yml'); puts 'YAML parses'"

View task →

@Gonza10V
Gonza10V merged commit a2d220f into platform_update Jul 17, 2026
@Gonza10V
Gonza10V deleted the agent/deploy-after-validation branch July 17, 2026 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant