Skip to content

Commit a11ad41

Browse files
feat: Update Bicep workflow template with latest trigger (#2551)
Co-authored-by: Erika Gressi <[email protected]>
1 parent 0e96cfa commit a11ad41

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

docs/content/contributing/bicep/bicep-contribution-flow/_index.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,20 @@ If you're working on a new module, we'd also ask you to create its corresponding
425425

426426
{{% /expand %}}
427427

428+
{{% notice style="note" %}}
429+
430+
The workflow is configured to be triggered by any changes in the `main` branch of Upstream (i.e., `Azure/bicep-registry-modules`) that could affect the module or its validation. However, in a fork, the workflow is stopped immediately after being triggered due to the condition:
431+
```yml
432+
# Only run if not canceled and not in a fork, unless triggered by a workflow_dispatch event
433+
if: ${{ !cancelled() && !(github.repository != 'Azure/bicep-registry-modules' && github.event_name != 'workflow_dispatch') }}
434+
```
435+
This condition prevents accidentally triggering a large amount of module workflows, e.g., when merging upstream changes into your fork.
436+
437+
In forks, workflow validation remains possible through explicit runs (that is, by using the  `workflow_dispatch`  event).
438+
439+
{{% /notice %}}
440+
441+
428442
{{% notice style="tip" %}}
429443

430444
After any change to a module and before running tests, we highly recommend running the [Set-AVMModule]({{% siteparam base %}}/contributing/bicep/bicep-contribution-flow/generate-bicep-module-files) utility to update all module files that are auto-generated (e.g., the `main.json` & `readme.md` files).

docs/static/includes/avm.workflow.template.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ jobs:
5353
job_initialize_pipeline:
5454
runs-on: ubuntu-latest
5555
name: "Initialize pipeline"
56+
if: ${{ !cancelled() && !(github.repository != 'Azure/bicep-registry-modules' && github.event_name != 'workflow_dispatch') }}
5657
steps:
5758
- name: "Checkout"
5859
uses: actions/checkout@v5

0 commit comments

Comments
 (0)