Enable or Disable Workflows
When forking the BRM repository, all workflows from the CI environment are also part of your fork. In an earlier step it was explained, how to set them up correctly, to verify your module development.
Due to the trigger mechanism of the workflows, eventually all of them run at some point in time, creating and deleting resources on Azure in your environment. That will also happen for modules, you are not working on. This will create costs in your own subscription and it can also create a queue for workflow runs, due to the lack of enough free agents.
To limit those workflow runs, you can manually disable each pipeline you do not want to run. As this is a time consuming task, there is script in the BRM repository, to disable (or enable) pipelines in a batch process, that can also be run via a workflow. You can also use RegEx to specify which pipelines should be included and which should be excluded.
You can find the script under
avm/utilities/pipelines/platform/Switch-WorkflowState.ps1)
You can find the workflow under
.github/workflows/platform.toggle-avm-workflows.yml
Browse to Actions
and select the workflow from the list
Run the workflow platform.toggle-avm-workflows
and set the following settings:
Enable or disable workflows
to enable or disable workflowsRegEx which workflows are included
include a specific set of workflows, using a RegEx.RegEx which workflows are excluded
exclude a specific set of workflows, using a RegEx.
Enable or disable workflows
toDisable
RegEx which workflows are included
toavm\.(?:res|ptn|utl)
(this is the default setting)RegEx which workflows are excluded
toavm.res.compute.virtual-machine
(use the name of your own workflow. This example uses the workflow for virtual machine)
Enable or disable workflows
toDisable
RegEx which workflows are included
toavm\.(?:res|ptn|utl)
(this is the default setting)RegEx which workflows are excluded
to(?:avm.res.compute.virtual-machine|avm.res.compute.image|avm.res.compute.disk)
(use the names of your own workflows. This example uses the workflows for virtual machine, image, and disk)
Enable or disable workflows
toEnable
RegEx which workflows are included
toavm\.(?:res|ptn|utl)
(this is the default setting)RegEx which workflows are excluded
to^$
(this is the default setting)
Please keep in mind, that the workflow run disables all workflows that match the RegEx at that point in time. If you sync your fork with the original repository and new workflows are there, they will be synced to your repository and will be enabled by default. So you will need to run the workflow to disable the new ones again after the sync.
The workflow can only be triggered in forks.