Skip to content

Commit

Permalink
fix: Expanded workflow fetch to not only fetch the first 50 workflows (
Browse files Browse the repository at this point in the history
…#807)

## Description

By default, the function that fetches the workflows from GitHub only
includes the first 50. Hence added an explicit limit (`999`) that
fetches e.g. 83 workflows.

| Pipeline |
| - |

[![avm.platform.toggle-avm-workflows](https://github.com/AlexanderSehr/bicep-registry-modules/actions/workflows/avm.platform.toggle-avm-workflows.yml/badge.svg?branch=users%2Falsehr%2FtoggleFetchLimit&event=workflow_dispatch)](https://github.com/AlexanderSehr/bicep-registry-modules/actions/workflows/avm.platform.toggle-avm-workflows.yml)

###
[Before](https://github.com/AlexanderSehr/bicep-registry-modules/actions/runs/7506887201/job/20439289640)
```
VERBOSE: + Enabled workflow [avm.res.api-management.service]
VERBOSE: + Enabled workflow [avm.res.app.managed-environment]
VERBOSE: + Enabled workflow [avm.res.automation.automation-account]
VERBOSE: + Enabled workflow [avm.res.cognitive-services.account]
VERBOSE: + Enabled workflow [avm.res.compute.disk-encryption-set]
VERBOSE: + Enabled workflow [avm.res.compute.gallery]
VERBOSE: + Enabled workflow [avm.res.compute.proximity-placement-group]
VERBOSE: + Enabled workflow [avm.res.compute.ssh-public-key]
VERBOSE: + Enabled workflow [avm.res.data-factory.factory]
VERBOSE: + Enabled workflow [avm.res.db-for-postgre-sql.flexible-server]
VERBOSE: + Enabled workflow [avm.res.document-db.database-account]
VERBOSE: + Enabled workflow [avm.res.event-grid.domain]
VERBOSE: + Enabled workflow [avm.res.event-grid.system-topic]
VERBOSE: + Enabled workflow [avm.res.event-grid.topic]
VERBOSE: + Enabled workflow [avm.res.insights.action-group]
VERBOSE: + Enabled workflow [avm.res.insights.activity-log-alert]
VERBOSE: + Enabled workflow [avm.res.insights.component]
VERBOSE: + Enabled workflow [avm.res.insights.data-collection-endpoint]
VERBOSE: + Enabled workflow [avm.res.insights.data-collection-rule]
VERBOSE: + Enabled workflow [avm.res.insights.diagnostic-setting]
VERBOSE: + Enabled workflow [avm.res.insights.metric-alert]
VERBOSE: + Enabled workflow [avm.res.insights.scheduled-query-rule]
VERBOSE: + Enabled workflow [avm.res.insights.webtest]
VERBOSE: + Enabled workflow [avm.res.key-vault.vault]
VERBOSE: + Enabled workflow [avm.res.kubernetes-configuration.extension]
VERBOSE: + Enabled workflow [avm.res.kubernetes-configuration.flux-configuration]
VERBOSE: + Enabled workflow [avm.res.logic.workflow]
VERBOSE: + Enabled workflow [avm.res.maintenance.maintenance-configuration]
VERBOSE: + Enabled workflow [avm.res.managed-identity.user-assigned-identity]
VERBOSE: + Enabled workflow [avm.res.network.application-security-group]
VERBOSE: + Enabled workflow [avm.res.network.bastion-host]
VERBOSE: + Enabled workflow [avm.res.network.connection]
VERBOSE: + Enabled workflow [avm.res.network.ddos-protection-plan]
VERBOSE: + Enabled workflow [avm.res.network.dns-forwarding-ruleset]
VERBOSE: + Enabled workflow [avm.res.network.dns-resolver]
VERBOSE: + Enabled workflow [avm.res.network.dns-zone]
VERBOSE: + Enabled workflow [avm.res.network.express-route-circuit]
VERBOSE: + Enabled workflow [avm.res.network.express-route-gateway]
VERBOSE: + Enabled workflow [avm.res.network.firewall-policy]
VERBOSE: + Enabled workflow [avm.res.network.front-door-web-application-firewall-policy]
VERBOSE: + Enabled workflow [avm.res.network.front-door]
VERBOSE: + Enabled workflow [avm.res.network.load-balancer]
VERBOSE: + Enabled workflow [avm.res.network.nat-gateways]
VERBOSE: + Enabled workflow [avm.res.network.network-interface]
```

### After
```
VERBOSE: + Enabled workflow [avm.res.api-management.service]
VERBOSE: + Enabled workflow [avm.res.app.managed-environment]
VERBOSE: + Enabled workflow [avm.res.automation.automation-account]
VERBOSE: + Enabled workflow [avm.res.batch.batch-account]
VERBOSE: + Enabled workflow [avm.res.cognitive-services.account]
VERBOSE: + Enabled workflow [avm.res.compute.disk-encryption-set]
VERBOSE: + Enabled workflow [avm.res.compute.gallery]
VERBOSE: + Enabled workflow [avm.res.compute.proximity-placement-group]
VERBOSE: + Enabled workflow [avm.res.compute.ssh-public-key]
VERBOSE: + Enabled workflow [avm.res.compute.virtual-machine]
VERBOSE: + Enabled workflow [avm.res.container-service.managed-cluster]
VERBOSE: + Enabled workflow [avm.res.data-factory.factory]
VERBOSE: + Enabled workflow [avm.res.db-for-postgre-sql.flexible-server]
VERBOSE: + Enabled workflow [avm.res.document-db.database-account]
VERBOSE: + Enabled workflow [avm.res.event-grid.domain]
VERBOSE: + Enabled workflow [avm.res.event-grid.system-topic]
VERBOSE: + Enabled workflow [avm.res.event-grid.topic]
VERBOSE: + Enabled workflow [avm.res.insights.action-group]
VERBOSE: + Enabled workflow [avm.res.insights.activity-log-alert]
VERBOSE: + Enabled workflow [avm.res.insights.component]
VERBOSE: + Enabled workflow [avm.res.insights.data-collection-endpoint]
VERBOSE: + Enabled workflow [avm.res.insights.data-collection-rule]
VERBOSE: + Enabled workflow [avm.res.insights.diagnostic-setting]
VERBOSE: + Enabled workflow [avm.res.insights.metric-alert]
VERBOSE: + Enabled workflow [avm.res.insights.scheduled-query-rule]
VERBOSE: + Enabled workflow [avm.res.insights.webtest]
VERBOSE: + Enabled workflow [avm.res.key-vault.vault]
VERBOSE: + Enabled workflow [avm.res.kubernetes-configuration.extension]
VERBOSE: + Enabled workflow [avm.res.kubernetes-configuration.flux-configuration]
VERBOSE: + Enabled workflow [avm.res.logic.workflow]
VERBOSE: + Enabled workflow [avm.res.maintenance.maintenance-configuration]
VERBOSE: + Enabled workflow [avm.res.managed-identity.user-assigned-identity]
VERBOSE: + Enabled workflow [avm.res.network.application-security-group]
VERBOSE: + Enabled workflow [avm.res.network.bastion-host]
VERBOSE: + Enabled workflow [avm.res.network.connection]
VERBOSE: + Enabled workflow [avm.res.network.ddos-protection-plan]
VERBOSE: + Enabled workflow [avm.res.network.dns-forwarding-ruleset]
VERBOSE: + Enabled workflow [avm.res.network.dns-resolver]
VERBOSE: + Enabled workflow [avm.res.network.dns-zone]
VERBOSE: + Enabled workflow [avm.res.network.express-route-circuit]
VERBOSE: + Enabled workflow [avm.res.network.express-route-gateway]
VERBOSE: + Enabled workflow [avm.res.network.firewall-policy]
VERBOSE: + Enabled workflow [avm.res.network.front-door-web-application-firewall-policy]
VERBOSE: + Enabled workflow [avm.res.network.front-door]
VERBOSE: + Enabled workflow [avm.res.network.load-balancer]
VERBOSE: + Enabled workflow [avm.res.network.nat-gateways]
VERBOSE: + Enabled workflow [avm.res.network.network-interface]
VERBOSE: + Enabled workflow [avm.res.network.network-security-group]
VERBOSE: + Enabled workflow [avm.res.network.private-dns-zone]
VERBOSE: + Enabled workflow [avm.res.network.private-endpoint]
VERBOSE: + Enabled workflow [avm.res.network.public-ip-address]
VERBOSE: + Enabled workflow [avm.res.network.public-ip-prefix]
VERBOSE: + Enabled workflow [avm.res.network.route-table]
VERBOSE: + Enabled workflow [avm.res.network.trafficmanagerprofile]
VERBOSE: + Enabled workflow [avm.res.network.virtual-network]
VERBOSE: + Enabled workflow [avm.res.network.vpn-gateway]
VERBOSE: + Enabled workflow [avm.res.network.vpn-site]
VERBOSE: + Enabled workflow [avm.res.operational-insights.workspace]
VERBOSE: + Enabled workflow [avm.res.operations-management.solution]
VERBOSE: + Enabled workflow [avm.res.power-bi-dedicated.capacity]
VERBOSE: + Enabled workflow [avm.res.resource-graph.query]
VERBOSE: + Enabled workflow [avm.res.resources.deployment-script]
VERBOSE: + Enabled workflow [avm.res.resources.resource-group]
VERBOSE: + Enabled workflow [avm.res.search.search-service]
VERBOSE: + Enabled workflow [avm.res.service-bus.namespace]
VERBOSE: + Enabled workflow [avm.res.sql.server]
VERBOSE: + Enabled workflow [avm.res.storage.storage-account]
VERBOSE: + Enabled workflow [avm.res.virtual-machine-images.image-template]
VERBOSE: + Enabled workflow [avm.res.web.serverfarm]
VERBOSE: + Enabled workflow [avm.res.web.static-site]
```

---------

Co-authored-by: Erika Gressi <[email protected]>
  • Loading branch information
AlexanderSehr and eriqua authored Jan 13, 2024
1 parent bbd09c9 commit dd9fd8d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion avm/utilities/pipelines/platform/Switch-WorkflowState.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ function Switch-WorkflowState {
throw 'Function should not run for [Azure/bicep-registry-modules].'
}

$workflows = gh workflow list --repo $repo --all --json "name,state,id" | ConvertFrom-Json -Depth 100
$workflows = gh workflow list --repo $repo --all --json "name,state,id" --limit 999 | ConvertFrom-Json -Depth 100
$relevantWorkflows = $workflows | Where-Object {
$_.name -match $IncludePattern -and $_.name -notmatch $ExlcudePattern
}
Expand Down

0 comments on commit dd9fd8d

Please sign in to comment.