Skip to content

Conversation

@AlexanderSehr
Copy link
Collaborator

@AlexanderSehr AlexanderSehr commented Jan 14, 2026

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:

# 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

Pipeline
avm.res.compute.gallery

Type of Change

  • 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
  • Update to CI Environment or utilities (Non-module affecting changes)

@AlexanderSehr AlexanderSehr self-assigned this Jan 14, 2026
@microsoft-github-policy-service microsoft-github-policy-service bot added Needs: Triage 🔍 Maintainers need to triage still Type: AVM 🅰️ ✌️ Ⓜ️ This is an AVM related issue labels Jan 14, 2026
@AlexanderSehr AlexanderSehr marked this pull request as ready for review January 14, 2026 08:22
@AlexanderSehr AlexanderSehr requested a review from a team as a code owner January 14, 2026 08:22
Copy link
Collaborator

@eriqua eriqua left a comment

Choose a reason for hiding this comment

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

🆗

@eriqua eriqua self-assigned this Jan 14, 2026
@eriqua eriqua added Type: CI 🚀 This issue is related to the AVM CI and removed Needs: Triage 🔍 Maintainers need to triage still labels Jan 14, 2026
@AlexanderSehr AlexanderSehr merged commit 5289aae into main Jan 15, 2026
13 checks passed
@AlexanderSehr AlexanderSehr deleted the users/alsehr/pipelineCond branch January 15, 2026 07:18
yffok pushed a commit to yffok/bicep-registry-modules that referenced this pull request Jan 15, 2026
…kflow runs in a forks main branch (Azure#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)
AlexanderSehr added a commit that referenced this pull request Jan 15, 2026
…e' condition is implemented (#6503)

## Description

Adds a test that ensures that the conditions 
- `!cancelled()`
- `!(github.repository != 'Azure/bicep-registry-modules' &&
github.event_name != 'workflow_dispatch')`

exist as a condition for the `job_initialize_pipeline` pipeline step.

Related to 
- #6502
- Azure/Azure-Verified-Modules#2551

Output for passing test
```
  [+] [analysis-services/server] GitHub workflow [avm.res.analysis-services.server.yml]. Should have the expected push trigger path filters. 59ms (58ms|1ms)
  [+] [analysis-services/server] GitHub workflow [avm.res.analysis-services.server.yml]. Should have a condition to run only automatically on changes in upstream main. 80ms (79ms|1ms)
  [+] [analysis-services/server] GitHub workflow [avm.res.analysis-services.server.yml]. Should only have the expected push trigger path filters. 64ms (62ms|2ms)
```

Output for failed test
```
  [+] [web/site] GitHub workflow [avm.res.web.site.yml]. Should have the expected push trigger path filters. 4ms (2ms|2ms)
  [-] [web/site] GitHub workflow [avm.res.web.site.yml]. Should have a condition to run only automatically on changes in upstream main. 27ms (25ms|2ms)
   Expected 0, because the number of missing conditions of the `job_initialize_pipeline` step should be 0, but got [!cancelled(), !(github.repository != 'Azure/bicep-registry-modules' && github.event_name != 'workflow_dispatch')]., but got 2.
   at $missingConditions.Count | Should -Be 0 -Because ('the number of missing conditions of the `job_initialize_pipeline` step should be 0, but got [{0}].' -f ($missingConditions -join ', ')), C:\dev\ip\bicep-registry-modules\Upstream-Azure\utilities\pipelines\staticValidation\compliance\module.tests.ps1:617
   at <ScriptBlock>, C:\dev\ip\bicep-registry-modules\Upstream-Azure\utilities\pipelines\staticValidation\compliance\module.tests.ps1:617
  [+] [web/site] GitHub workflow [avm.res.web.site.yml]. Should only have the expected push trigger path filters. 3ms (2ms|1ms)
```

## Pipeline Reference

<!-- Insert your Pipeline Status Badge below -->

| Pipeline |
| -------- |

[![avm.res.analysis-services.server](https://github.com/Azure/bicep-registry-modules/actions/workflows/avm.res.analysis-services.server.yml/badge.svg?branch=users%2Falsehr%2FcondTest&event=workflow_dispatch)](https://github.com/Azure/bicep-registry-modules/actions/workflows/avm.res.analysis-services.server.yml)
(should pass)

[![avm.res.web.site](https://github.com/Azure/bicep-registry-modules/actions/workflows/avm.res.web.site.yml/badge.svg?branch=users%2Falsehr%2FcondTest&event=workflow_dispatch)](https://github.com/Azure/bicep-registry-modules/actions/workflows/avm.res.web.site.yml)
(should fail)

## 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)

---------

Co-authored-by: Erika Gressi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs: Core Team 🧞 This item needs the AVM Core Team to review it Type: AVM 🅰️ ✌️ Ⓜ️ This is an AVM related issue Type: CI 🚀 This issue is related to the AVM CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants