Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-docker-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,5 @@ jobs:
registry: cmsacontainerreg.azurecr.io
app_name: ${{ matrix.app_name }}
dockerfile: ${{ matrix.dockerfile }}
push: ${{ github.ref_name == 'main' || github.ref_name == 'dev' || github.ref_name == 'demo' || github.ref_name == 'hotfix' }}
push: ${{ github.event_name != 'pull_request' && (github.ref_name == 'main' || github.ref_name == 'dev' || github.ref_name == 'demo' || github.ref_name == 'hotfix') }}
secrets: inherit
7 changes: 4 additions & 3 deletions .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,23 @@ on:
jobs:
docker-build:
runs-on: ubuntu-latest
environment: production
# Pull request runs (including forks) never use the production environment or Azure credentials.
environment: ${{ github.event_name != 'pull_request' && 'production' || '' }}
steps:

- name: Checkout
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6

- name: Login to Azure
if: ${{ inputs.push }}
if: ${{ inputs.push && github.event_name != 'pull_request' }}
uses: azure/login@7ddb5af1ef8758cf1353cf3b42f940aee27ba21c # v3
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}

- name: Login to ACR
if: ${{ inputs.push }}
if: ${{ inputs.push && github.event_name != 'pull_request' }}
run: az acr login --name ${{ inputs.registry }}

- name: Set up Docker Buildx
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/deploy-v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,12 @@ on:

jobs:
validate-inputs:
# Only deploy for non-PR workflow_run events from this repository (not forks) whose build succeeded.
if: >-
github.event_name != 'workflow_run' ||
(github.event.workflow_run.head_repository.full_name == github.repository &&
github.event.workflow_run.event != 'pull_request' &&
github.event.workflow_run.conclusion == 'success')
runs-on: ubuntu-latest
outputs:
validation_passed: ${{ steps.validate.outputs.passed }}
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ env:

jobs:
deploy:
# Only deploy for non-PR workflow_run events from this repository (not forks) whose build succeeded.
if: >-
github.event_name != 'workflow_run' ||
(github.event.workflow_run.head_repository.full_name == github.repository &&
github.event.workflow_run.event != 'pull_request' &&
github.event.workflow_run.conclusion == 'success')
Comment thread
Copilot marked this conversation as resolved.
Resolved
runs-on: ubuntu-latest
environment: production
outputs:
Expand Down
Loading