Skip to content

Commit 5289aae

Browse files
feat: CI - Introduced workflow condition that prevents accidental workflow runs in a forks main branch (#6502)
## Description The workflow is configured in a way that it will trigger on any changes in Upstream's (i.e., `Azure/bicep-registry-modules`) `main` branch if they may have an impact on the module or its validation. However, while in a fork, the workflow will stop right after initiation thanks to the condition: ```yml # Only run if not canceled and not in a fork, unless triggered by a workflow_dispatch event if: ${{ !cancelled() && !(github.repository != 'Azure/bicep-registry-modules' && github.event_name != 'workflow_dispatch') }} ``` This condition ensures that you don't accidently trigger a large amount of module workflows when e.g., merging changes from upstream into your fork. Due to the nature of triggers it's unfortunately not possible to not trigger them outright. ## Pipeline Reference <!-- Insert your Pipeline Status Badge below --> | Pipeline | | -------- | [![avm.res.compute.gallery](https://github.com/Azure/bicep-registry-modules/actions/workflows/avm.res.compute.gallery.yml/badge.svg?branch=users%2Falsehr%2FpipelineCond&event=workflow_dispatch)](https://github.com/Azure/bicep-registry-modules/actions/workflows/avm.res.compute.gallery.yml) ## Type of Change <!-- Use the checkboxes [x] on the options that are relevant. --> - Azure Verified Module updates: - [ ] Bugfix containing backwards-compatible bug fixes, and I have NOT bumped the MAJOR or MINOR version in `version.json`: - [ ] Feature update backwards compatible feature updates, and I have bumped the MINOR version in `version.json`. - [ ] Breaking changes and I have bumped the MAJOR version in `version.json`. - [ ] Update to documentation - [x] Update to CI Environment or utilities (Non-module affecting changes)
1 parent b49c0ef commit 5289aae

File tree

209 files changed

+211
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

209 files changed

+211
-2
lines changed

.github/workflows/avm.ptn.aca-lza.hosting-environment.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ jobs:
4949
job_initialize_pipeline:
5050
runs-on: ubuntu-latest
5151
name: "Initialize pipeline"
52+
if: ${{ !cancelled() && !(github.repository != 'Azure/bicep-registry-modules' && github.event_name != 'workflow_dispatch') }}
5253
steps:
5354
- name: "Checkout"
5455
uses: actions/checkout@v5

.github/workflows/avm.ptn.ai-ml.ai-foundry.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ jobs:
4949
job_initialize_pipeline:
5050
runs-on: ubuntu-latest
5151
name: "Initialize pipeline"
52+
if: ${{ !cancelled() && !(github.repository != 'Azure/bicep-registry-modules' && github.event_name != 'workflow_dispatch') }}
5253
steps:
5354
- name: "Checkout"
5455
uses: actions/checkout@v5

.github/workflows/avm.ptn.ai-platform.baseline.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ jobs:
4949
job_initialize_pipeline:
5050
runs-on: ubuntu-latest
5151
name: "Initialize pipeline"
52+
if: ${{ !cancelled() && !(github.repository != 'Azure/bicep-registry-modules' && github.event_name != 'workflow_dispatch') }}
5253
steps:
5354
- name: "Checkout"
5455
uses: actions/checkout@v5

.github/workflows/avm.ptn.alz.ama.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ jobs:
4949
job_initialize_pipeline:
5050
runs-on: ubuntu-latest
5151
name: "Initialize pipeline"
52+
if: ${{ !cancelled() && !(github.repository != 'Azure/bicep-registry-modules' && github.event_name != 'workflow_dispatch') }}
5253
steps:
5354
- name: "Checkout"
5455
uses: actions/checkout@v5

.github/workflows/avm.ptn.alz.empty.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ jobs:
4949
job_initialize_pipeline:
5050
runs-on: ubuntu-latest
5151
name: "Initialize pipeline"
52+
if: ${{ !cancelled() && !(github.repository != 'Azure/bicep-registry-modules' && github.event_name != 'workflow_dispatch') }}
5253
steps:
5354
- name: "Checkout"
5455
uses: actions/checkout@v5

.github/workflows/avm.ptn.app-service-lza.hosting-environment.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ jobs:
4949
job_initialize_pipeline:
5050
runs-on: ubuntu-latest
5151
name: "Initialize pipeline"
52+
if: ${{ !cancelled() && !(github.repository != 'Azure/bicep-registry-modules' && github.event_name != 'workflow_dispatch') }}
5253
steps:
5354
- name: "Checkout"
5455
uses: actions/checkout@v5

.github/workflows/avm.ptn.app.container-job-toolkit.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ jobs:
4949
job_initialize_pipeline:
5050
runs-on: ubuntu-latest
5151
name: "Initialize pipeline"
52+
if: ${{ !cancelled() && !(github.repository != 'Azure/bicep-registry-modules' && github.event_name != 'workflow_dispatch') }}
5253
steps:
5354
- name: "Checkout"
5455
uses: actions/checkout@v5

.github/workflows/avm.ptn.app.iaas-vm-cosmosdb-tier4.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ jobs:
4949
job_initialize_pipeline:
5050
runs-on: ubuntu-latest
5151
name: "Initialize pipeline"
52+
if: ${{ !cancelled() && !(github.repository != 'Azure/bicep-registry-modules' && github.event_name != 'workflow_dispatch') }}
5253
steps:
5354
- name: "Checkout"
5455
uses: actions/checkout@v5

.github/workflows/avm.ptn.app.paas-ase-cosmosdb-tier4.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ jobs:
4949
job_initialize_pipeline:
5050
runs-on: ubuntu-latest
5151
name: "Initialize pipeline"
52+
if: ${{ !cancelled() && !(github.repository != 'Azure/bicep-registry-modules' && github.event_name != 'workflow_dispatch') }}
5253
steps:
5354
- name: "Checkout"
5455
uses: actions/checkout@v5

.github/workflows/avm.ptn.authorization.pim-role-assignment.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ jobs:
4949
job_initialize_pipeline:
5050
runs-on: ubuntu-latest
5151
name: "Initialize pipeline"
52+
if: ${{ !cancelled() && !(github.repository != 'Azure/bicep-registry-modules' && github.event_name != 'workflow_dispatch') }}
5253
steps:
5354
- name: "Checkout"
5455
uses: actions/checkout@v5

0 commit comments

Comments
 (0)