Skip to content

fix: fix for icm issue - #509

Merged
Roopan-Microsoft merged 2 commits into
mainfrom
psl-icm-fix
Nov 5, 2026
Merged

Roopan-Microsoft merged 2 commits into
mainfrom
psl-icm-fix

Conversation

@NirajC3-Microsoft

Copy link
Copy Markdown
Contributor

Purpose

This pull request improves the security and reliability of the CI/CD GitHub Actions workflows by ensuring that sensitive deployment steps and credentials are never used in pull request runs or from forked repositories. It also restricts deployments to only occur when builds from the main repository have succeeded.

The most important changes are:

Security and environment handling:

  • In .github/workflows/build-docker.yml, the environment is now only set to production for non-pull request events, preventing exposure of production secrets during pull request runs. The Azure login and ACR login steps are also restricted to non-pull request events.
  • In .github/workflows/build-docker-images.yml, Docker images are only pushed if the event is not a pull request and the branch is one of the deployment branches, preventing accidental pushes from pull requests.

Deployment restrictions:

  • In .github/workflows/deploy.yml and .github/workflows/deploy-v2.yml, deployments are now restricted to workflow runs that originated from the main repository and only if the build succeeded, preventing deployments from forks or failed builds. [1] [2]

Does this introduce a breaking change?

  • Yes
  • No

Golden Path Validation

  • I have tested the primary workflows (the "golden path") to ensure they function correctly without errors.

Deployment Validation

  • I have validated the deployment process successfully and all services are running as expected with this change.

What to Check

Verify that the following are valid

  • ...

Other Information

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Both deployment workflows allow successful same-repository PR validation runs to trigger production deployment and Azure login even though those runs do not publish images.

1 open issue
What changed in this PR

This PR hardens the Docker build and Azure deployment workflows by restricting production access during pull request builds and adding checks on completed builds before deployment.

Changes:

  • Excludes pull request builds from the production environment and Azure/ACR login steps.
  • Prevents image publishing for pull request events.
  • Gates automatic deployments on successful builds originating from the same repository.
File Description
.github/​workflows/​deploy.yml Adds repository and build-success checks before deployment.
.github/​workflows/​deploy-v2.yml Adds the same checks before input validation and downstream deployment.
.github/​workflows/​build-docker.yml Restricts production environment selection and login steps for PR builds.
.github/​workflows/​build-docker-images.yml Excludes PR events from the image-publishing condition.

Review effort: Balanced

Comment thread .github/workflows/deploy.yml Resolved
Copilot AI balanced review requested due to automatic review settings November 5, 2026 05:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues are reported for the CI/CD workflow hardening changes.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@Roopan-Microsoft
Roopan-Microsoft merged commit 3ca5120 into main Nov 5, 2026
11 checks passed
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.

3 participants