Skip to content

Align to Role Assignments AVM specs #4123

Closed

Description

Modules with role Assignments (divided by PR):

Chunk [1]
  • aad\domain-service
  • analysis-services\server
  • api-management\service
  • app\container-app
  • app\managed-environment
  • app-configuration\configuration-store
  • automation\automation-account
  • cache\redis
  • cache\redis-enterprise
  • cdn\profile
  • cognitive-services\account
  • compute\availability-set
  • compute\disk
  • compute\disk-encryption-set
  • compute\gallery
  • compute\gallery\application
  • compute\gallery\image
  • compute\image
  • compute\proximity-placement-group
  • compute\ssh-public-key
  • compute\virtual-machine
  • compute\virtual-machine-scale-set
  • container-registry\registry
  • container-service\managed-cluster
  • data-factory\factory
  • data-protection\backup-vault
  • databricks\access-connector
  • databricks\workspace
  • db-for-my-sql\flexible-server
  • db-for-postgre-sql\flexible-server
  • desktop-virtualization\application-group
  • desktop-virtualization\host-pool
  • desktop-virtualization\scaling-plan
  • desktop-virtualization\workspace
  • dev-test-lab\lab
  • digital-twins\digital-twins-instance
  • document-db\database-account
  • network\public-ip-address
  • network\network-interface
Chunk [2]
  • event-grid\domain
  • event-grid\system-topic
  • event-grid\topic
  • event-hub\namespace
  • event-hub\namespace\eventhub
  • health-bot\health-bot
  • healthcare-apis\workspace
  • healthcare-apis\workspace\fhirservice
  • insights\action-group
  • insights\activity-log-alert
  • insights\component
  • insights\data-collection-endpoint
  • insights\data-collection-rule
  • insights\metric-alert
  • insights\private-link-scope
  • insights\scheduled-query-rule
  • insights\webtest
  • key-vault\vault
  • key-vault\vault\key
  • key-vault\vault\secret
  • logic\workflow
  • machine-learning-services\workspace
  • maintenance\maintenance-configuration
  • managed-identity\user-assigned-identity
  • net-app\net-app-account
  • net-app\net-app-account\capacity-pool
  • net-app\net-app-account\capacity-pool\volume
Chunk [3]
  • network\application-gateway
  • network\application-security-group
  • network\azure-firewall
  • network\bastion-host
  • network\ddos-protection-plan
  • network\dns-forwarding-ruleset
  • network\dns-resolver
  • network\dns-zone
  • network\dns-zone\a
  • network\dns-zone\aaaa
  • network\dns-zone\caa
  • network\dns-zone\cname
  • network\dns-zone\mx
  • network\dns-zone\ns
  • network\dns-zone\ptr
  • network\dns-zone\soa
  • network\dns-zone\srv
  • network\dns-zone\txt
  • network\express-route-circuit
  • network\express-route-gateway
  • network\front-door
  • network\front-door-web-application-firewall-policy
  • network\ip-group
  • network\load-balancer
  • network\local-network-gateway
  • network\nat-gateway
  • network\network-manager
  • network\network-security-group
  • network\network-watcher
  • network\private-dns-zone
  • network\private-dns-zone\a
  • network\private-dns-zone\aaaa
  • network\private-dns-zone\cname
  • network\private-dns-zone\mx
  • network\private-dns-zone\ptr
  • network\private-dns-zone\soa
  • network\private-dns-zone\srv
  • network\private-dns-zone\txt
  • network\private-link-service
  • network\public-ip-prefix
  • network\route-table
  • network\service-endpoint-policy
  • network\trafficmanagerprofile
  • network\virtual-network
  • network\virtual-network\subnet
  • network\virtual-network-gateway
  • network\virtual-wan
  • network\vpn-site
Chunk [4]
  • power-bi-dedicated\capacity
  • purview\account
  • relay\namespace
  • relay\namespace\hybrid-connection
  • relay\namespace\wcf-relay
  • resource-graph\query
  • resources\resource-group
  • search\search-service
  • service-bus\namespace
  • service-bus\namespace\queue
  • service-bus\namespace\topic
  • service-fabric\cluster
  • signal-r-service\signal-r
  • signal-r-service\web-pub-sub
  • sql\managed-instance
  • sql\server
  • storage\storage-account
  • storage\storage-account\blob-service\container
  • storage\storage-account\file-service\share
  • storage\storage-account\queue-service\queue
  • synapse\private-link-hub
  • synapse\workspace
  • virtual-machine-images\image-template
  • web\connection
  • web\hosting-environment
  • web\serverfarm
  • web\site
  • web\site\slot
  • web\static-site
  • operational-insights\workspace
  • recovery-services\vault
Snippet used for update
[CmdletBinding(SupportsShouldProcess)]
param (
    [Parameter()]
    [array] $modulesToInclude = @(
        # 'network\application-gateway',
        # 'network\application-security-group',
        # 'network\azure-firewall',
        # 'network\bastion-host',
        # 'network\ddos-protection-plan',
        # 'network\dns-forwarding-ruleset',
        # 'network\dns-resolver',
        # 'network\dns-zone',
        # 'network\dns-zone\a',
        # 'network\dns-zone\aaaa',
        # 'network\dns-zone\caa',
        # 'network\dns-zone\cname',
        # 'network\dns-zone\mx',
        # 'network\dns-zone\ns',
        # 'network\dns-zone\ptr',
        # 'network\dns-zone\soa',
        # 'network\dns-zone\srv',
        # 'network\dns-zone\txt',
        # 'network\express-route-circuit',
        # 'network\express-route-gateway',
        # 'network\front-door',
        # 'network\front-door-web-application-firewall-policy',
        # 'network\ip-group',
        # 'network\load-balancer',
        # 'network\local-network-gateway',
        # 'network\nat-gateway',
        # 'network\network-manager',
        # 'network\network-security-group',
        # 'network\network-watcher',
        # 'network\private-dns-zone',
        # 'network\private-dns-zone\a',
        # 'network\private-dns-zone\aaaa',
        # 'network\private-dns-zone\cname',
        # 'network\private-dns-zone\mx',
        # 'network\private-dns-zone\ptr',
        # 'network\private-dns-zone\soa',
        # 'network\private-dns-zone\srv',
        # 'network\private-dns-zone\txt',
        # 'network\private-link-service',
        # 'network\public-ip-prefix',
        # 'network\route-table',
        # 'network\service-endpoint-policy',
        # 'network\trafficmanagerprofile',
        # 'network\virtual-network',
        # 'network\virtual-network\subnet',
        # 'network\virtual-network-gateway',
        # 'network\virtual-wan',
        # 'network\vpn-site'
        'key-vault\vault'
    ),

    [Parameter(Mandatory = $false)]
    [string] $PersonalAccessToken,

    [Parameter(Mandatory = $false)]
    [string] $TargetBranch = (git branch --show-current)
)

$root = 'C:\dev\ip\Azure-ResourceModules\ResourceModules'

function Set-ManualContent {

    foreach ($relativeModulePath in $modulesToInclude) {
        $fullPath = Join-Path $root 'modules' $relativeModulePath

        $mainTemplatePath = Join-Path $fullPath 'main.bicep'
        $mainTemplateContent = Get-Content $mainTemplatePath

        $usesSysPrefix = ($mainTemplateContent | Out-String) -match '.*@sys*'

        #################
        #   Get Roles   #
        #################
        $bicepFolderPath = Join-Path $fullPath '.bicep'
        $rbacTemplatePath = Join-Path $bicepFolderPath 'nested_roleAssignments.bicep'
        if (Test-Path $bicepFolderPath) {

            $bicepTemplateContent = Get-Content $rbacTemplatePath

            $buildInRoleNamesStartIndex = $bicepTemplateContent.IndexOf('var builtInRoleNames = {')
            $buildInRoleNamesEndIndex = $buildInRoleNamesStartIndex

            while ($bicepTemplateContent[$buildInRoleNamesEndIndex] -ne '}') {
                $buildInRoleNamesEndIndex++
            }

            $rolesArray = $bicepTemplateContent[$buildInRoleNamesStartIndex..$buildInRoleNamesEndIndex]
        } else {
            $rolesArray = @()
        }

        #######################
        #   Update template   #
        #######################

        # We want to place the roles on top of the first block of resources
        # Add var
        if ($rolesArray.Count -ne 0) {
            $firstResourceIndex = 0
            while ($mainTemplateContent[$firstResourceIndex] -notmatch '^resource .+') {
                $firstResourceIndex++
            }
            $contentBefore = $mainTemplateContent[0 .. ($firstResourceIndex - 1)]
            $contentAfter = $mainTemplateContent[$firstResourceIndex .. $mainTemplateContent.Length]

            $mainTemplateContent = $contentBefore + $rolesArray + @('') + $contentAfter
        }

        # Replace parameter
        $mainTemplateContent = $mainTemplateContent -replace 'param roleAssignments array = \[\]', 'param roleAssignments roleAssignmentType'

        # Replace resource module block (if not already done)
        $originalRbacRegex = 'module (.+?)_roleAssignments.+'
        if (($mainTemplateContent | Out-String) -match $originalRbacRegex) {
            $underscopeIdentifier = $matches[1]

            $roleAssignmentModuleStartIndex = 0
            while ($mainTemplateContent[$roleAssignmentModuleStartIndex] -notmatch $originalRbacRegex) {
                $roleAssignmentModuleStartIndex++
            }

            $roleAssignmentModuleEndIndex = $roleAssignmentModuleStartIndex

            while ($mainTemplateContent[$roleAssignmentModuleEndIndex] -notmatch '^\}\]$') {
                $roleAssignmentModuleEndIndex++
            }

            if (($mainTemplateContent[$roleAssignmentModuleStartIndex .. $roleAssignmentModuleEndIndex] | Out-String) -match '\s*resourceId: ([a-zA-Z]+)\.id') {
                $moduleIdentifier = $matches[1]
                $hasScope = $true
            } else {
                $moduleIdentifier = $null
                $hasScope = $false
            }

            # Let's check if the identifier is always written the expected way
            if ($moduleIdentifier) {
                if ($underscopeIdentifier -ne $moduleIdentifier ) {
                    Write-Warning "Module [$relativeModulePath] uses [$underscopeIdentifier] which does not match the expected identifier [$moduleIdentifier]"
                }
            } else {
                $moduleIdentifier = $underscopeIdentifier
            }

            $contentBefore = $mainTemplateContent[0 .. ($roleAssignmentModuleStartIndex - 1)]
            $contentAfter = $mainTemplateContent[($roleAssignmentModuleEndIndex + 1) .. $mainTemplateContent.Length]

            $newContent = @(
                ("resource exampleResource_roleAssignments 'Microsoft.Authorization/roleAssignments@2022-04-01' = [for (roleAssignment, index) in (roleAssignments ?? []): {" -replace 'exampleResource', $moduleIdentifier),
                ('  name: guid(exampleResource.id, roleAssignment.principalId, roleAssignment.roleDefinitionIdOrName)' -replace 'exampleResource', $moduleIdentifier),
                '  properties: {',
                '    roleDefinitionId: contains(builtInRoleNames, roleAssignment.roleDefinitionIdOrName) ? builtInRoleNames[roleAssignment.roleDefinitionIdOrName] : roleAssignment.roleDefinitionIdOrName',
                '    principalId: roleAssignment.principalId',
                '    description: roleAssignment.?description',
                '    principalType: roleAssignment.?principalType',
                '    condition: roleAssignment.?condition',
                "    conditionVersion: !empty(roleAssignment.?condition) ? (roleAssignment.?conditionVersion ?? '2.0') : null // Must only be set if condtion is set",
                '    delegatedManagedIdentityResourceId: roleAssignment.?delegatedManagedIdentityResourceId',
                '  }',
                ($hasScope ? "  scope: $moduleIdentifier" : $null),
                '}]'
            ) | Where-Object { $_ -ne $null }
            $mainTemplateContent = $contentBefore + $newContent + $contentAfter
        }

        # Add type
        if (($mainTemplateContent | Out-String) -notmatch '\/\/   Definitions   \/\/') {
            $mainTemplateContent += @(
                '// =============== //',
                '//   Definitions   //',
                '// =============== //'
            )
        }

        if (($mainTemplateContent | Out-String) -notmatch 'type roleAssignmentType') {
            $rbacType = @(
                ''
                'type roleAssignmentType = {',
                "  @description('Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead.')" ,
                '  roleDefinitionIdOrName: string',
                '',
                "  @description('Required. The principal ID of the principal (user/group/identity) to assign the role to.')" ,
                '  principalId: string',
                '',
                "  @description('Optional. The principal type of the assigned principal ID.')" ,
                "  principalType: ('ServicePrincipal' | 'Group' | 'User' | 'ForeignGroup' | 'Device' | null)?",
                '',
                "  @description('Optional. The description of the role assignment.')" ,
                '  description: string?',
                '',
                "  @description('Optional. The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase `"foo_storage_container`"')" ,
                '  condition: string?',
                '',
                "  @description('Optional. Version of the condition.')" ,
                "  conditionVersion: '2.0'?",
                '',
                "  @description('Optional. The Resource Id of the delegated managed identity resource.')" ,
                '  delegatedManagedIdentityResourceId: string?',
                '}[]?'
            )
            if ($usesSysPrefix) {
                for ($index = 0; $index -lt $rbacType.Count; $index++) {
                    $rbacType[$index] = $rbacType[$index] -replace '\@description', '@sys.description'
                }
            }
            $mainTemplateContent += $rbacType
        }

        ###############
        #   Cleanup   #
        ###############

        # Delete original rbac template
        if (Test-Path $rbacTemplatePath) {
            if ($PSCmdlet.ShouldProcess("File [$rbacTemplatePath]", 'Remove')) {
                $null = Remove-Item $rbacTemplatePath -Force
            }
        }

        # Delete .bicep folder if empty
        if (Test-Path $bicepFolderPath) {
            if ((Get-ChildItem -File -Path $bicepFolderPath).Count -eq 0) {
                if ($PSCmdlet.ShouldProcess("Folder [$bicepFolderPath]", 'Remove')) {
                    $null = Remove-Item $bicepFolderPath -Force
                }
            } else {
                # If we run & stop the script multiple times, there may already be an empty modules folder. That we have to remove first
                $modulesFolderPath = Join-Path $fullPath 'modules'
                if ((Test-Path $modulesFolderPath) -and (Get-ChildItem $modulesFolderPath -File).Count -eq 0) {
                    if ($PSCmdlet.ShouldProcess("Folder [$bicepFolderPath]", 'Remove')) {
                        $null = Remove-Item $modulesFolderPath -Force
                    }
                }

                if ($PSCmdlet.ShouldProcess("Folder [$bicepFolderPath] to 'modules'", 'Rename')) {
                    Rename-Item -Path $bicepFolderPath -NewName 'modules'
                }

                # Update references in main template
                foreach ($row in $mainTemplateContent) {
                    if ($row -like '*/.bicep/*') {
                        $row = $row -replace '.bicep\/', 'modules/'
                    }
                }
            }
        }

        ###################
        #   File Update   #
        ###################
        if ($PSCmdlet.ShouldProcess("File [$relativeModulePath]", 'Update')) {
            Set-Content -Path $mainTemplatePath -Value $mainTemplateContent
        }

        #######################
        # Test files update   #
        #######################
        $testFilePaths = (Get-ChildItem -Path $fullPath -Filter 'main.test.bicep' -Recurse -File).FullName
        foreach ($testFilePath in $testFilePaths) {
            $testFileContent = Get-Content $testFilePath -Raw
            # $principalIdsRegex = '(\s*)principalIds: \[\n(.+)\n(\s*)\]'
            $principalIdsRegex = '(\s*)principalIds: \[\s*(.+)\s*\]'
            if ($testFileContent -match $principalIdsRegex) {
                $testFileContent = $testFileContent -replace $principalIdsRegex, '$1principalId: $2'
                if ($PSCmdlet.ShouldProcess("Test file [$testFilePath]", 'Update')) {
                    $null = Set-Content -Path $testFilePath -Value $testFileContent
                }
            }
        }
    }
}

function Set-GeneratedContent {
    ###############################
    #   Regenerate module files   #
    ###############################

    # =============== #
    # Build Templates #
    # =============== #
    Write-Verbose 'Compiling all Bicep templates' -Verbose
    try {
        $job = $modulesToInclude | ForEach-Object -ThrottleLimit 10 -AsJob -Parallel {
            Write-Verbose "[$_] template update" -Verbose
            bicep build (Join-Path $using:root 'modules' $_ 'main.bicep')
        }
        do {
            # Sleep a bit to allow the threads to run - adjust as desired.
            Start-Sleep -Seconds 0.5

            # Determine how many jobs have completed so far.
            $completedJobsCount = ($job.ChildJobs | Where-Object { $_.State -notin @('NotStarted', 'Running') }).Count

            # Relay any pending output from the child jobs.
            $job | Receive-Job

            # Update the progress display.
            [int] $percent = ($completedJobsCount / $job.ChildJobs.Count) * 100
            Write-Progress -Activity ("Build [$completedJobsCount/{0}] files" -f $modulesToInclude.Count) -Status "$percent% complete" -PercentComplete $percent

        } while ($completedJobsCount -lt $job.ChildJobs.Count)

        # Clean up the job.
        $job | Remove-Job
    } finally {
        # In case the user cancelled the process, we need to make sure to stop all running jobs
        $job | Remove-Job -Force -ErrorAction 'SilentlyContinue'
    }

    # ================ #
    # Generate ReadMes #
    # ================ #
    Write-Verbose 'Fetching cross references' -Verbose
    . (Join-Path $root 'utilities' 'tools' 'Get-CrossReferencedModuleList.ps1')
    $crossReferencedModuleList = Get-CrossReferencedModuleList

    Write-Verbose 'Generating all ReadMes' -Verbose
    try {
        $job = $modulesToInclude | ForEach-Object -ThrottleLimit 10 -AsJob -Parallel {
            Write-Verbose "[$_] readme update" -Verbose
            . (Join-Path $using:root 'utilities' 'pipelines' 'sharedScripts' 'Set-ModuleReadMe.ps1')
            Set-ModuleReadMe -TemplateFilePath (Join-Path $using:root 'modules' $_ 'main.json') -CrossReferencedModuleList $using:crossReferencedModuleList
        }
        do {
            # Sleep a bit to allow the threads to run - adjust as desired.
            Start-Sleep -Seconds 0.5

            # Determine how many jobs have completed so far.
            $completedJobsCount = ($job.ChildJobs | Where-Object { $_.State -notin @('NotStarted', 'Running') }).Count

            # Relay any pending output from the child jobs.
            $job | Receive-Job

            # Update the progress display.
            [int] $percent = ($completedJobsCount / $job.ChildJobs.Count) * 100
            Write-Progress -Activity ("Generated [$completedJobsCount/{0}] readme files" -f $modulesToInclude.Count) -Status "$percent% complete" -PercentComplete $percent

        } while ($completedJobsCount -lt $job.ChildJobs.Count)

        # Clean up the job.
        $job | Remove-Job
    } finally {
        # In case the user cancelled the process, we need to make sure to stop all running jobs
        $job | Remove-Job -Force -ErrorAction 'SilentlyContinue'
    }
}

function Get-GitHubModuleWorkflowList {

    [CmdletBinding()]
    param (
        [Parameter(Mandatory = $true)]
        [string] $PersonalAccessToken,

        [Parameter(Mandatory = $true)]
        [string] $GitHubRepositoryOwner,

        [Parameter(Mandatory = $true)]
        [string] $GitHubRepositoryName,

        [Parameter(Mandatory = $false)]
        [string] $Filter = 'ms.*'
    )

    $allWorkflows = @()
    $page = 1
    do {
        $requestInputObject = @{
            Method  = 'GET'
            Uri     = "https://api.github.com/repos/$GitHubRepositoryOwner/$GitHubRepositoryName/actions/workflows?per_page=100&page=$page"
            Headers = @{
                Authorization = "Bearer $PersonalAccessToken"
            }
        }
        $response = Invoke-RestMethod @requestInputObject

        if (-not $response.workflows) {
            Write-Error "Request failed. Reponse: [$response]"
        }

        $allWorkflows += $response.workflows | Select-Object -Property @('id', 'name', 'path', 'badge_url') | Where-Object { (Split-Path $_.path -Leaf) -like $Filter }

        $expectedPages = [math]::ceiling($response.total_count / 100)
        $page++
    } while ($page -le $expectedPages)

    return $allWorkflows
}

function Invoke-GitHubWorkflow {

    [CmdletBinding(SupportsShouldProcess)]
    param (
        [Parameter(Mandatory = $true)]
        [string] $PersonalAccessToken,

        [Parameter(Mandatory = $true)]
        [string] $GitHubRepositoryOwner,

        [Parameter(Mandatory = $true)]
        [string] $GitHubRepositoryName,

        [Parameter(Mandatory = $false)]
        [hashtable] $GitHubPipelineInputs = @{},

        [Parameter(Mandatory = $true)]
        [string] $WorkflowFilePath,

        [Parameter(Mandatory = $false)]
        [string] $TargetBranch = 'main'
    )

    $workflowFileName = Split-Path $WorkflowFilePath -Leaf

    $requestInputObject = @{
        Method  = 'POST'
        Uri     = "https://api.github.com/repos/$GitHubRepositoryOwner/$GitHubRepositoryName/actions/workflows/$workflowFileName/dispatches"
        Headers = @{
            Authorization = "Bearer $PersonalAccessToken"
        }
        Body    = @{
            ref    = $TargetBranch
            inputs = $GitHubPipelineInputs
        } | ConvertTo-Json
    }
    if ($PSCmdlet.ShouldProcess("GitHub workflow [$workflowFileName] for branch [$TargetBranch]", 'Invoke')) {
        $response = Invoke-RestMethod @requestInputObject -Verbose:$false

        if ($response) {
            Write-Error "Request failed. Reponse: [$response]"
            return $false
        }
    }

    return $true
}

function Invoke-WorkflowList {

    [CmdletBinding(SupportsShouldProcess)]
    param (
        [Parameter(Mandatory = $true)]
        [string] $PersonalAccessToken,

        [Parameter(Mandatory = $true)]
        [string] $TargetBranch,

        [Parameter(Mandatory = $false)]
        [string] $RepositoryRoot = 'C:\dev\ip\Azure-ResourceModules\ResourceModules',

        [Parameter(Mandatory = $false)]
        [string] $GitHubRepositoryOwner = 'Azure',

        [Parameter(Mandatory = $false)]
        [string] $GitHubRepositoryName = 'ResourceModules',

        [Parameter(Mandatory = $false)]
        [hashtable] $GitHubPipelineInputs = @{
            prerelease           = 'false'
            staticValidation     = 'true'
            deploymentValidation = 'true'
            removeDeployment     = 'true'
        }
    )

    . (Join-Path $RepositoryRoot 'utilities' 'tools' 'helper' 'Get-PipelineFileName.ps1')

    $relevantWorkflowPaths = $modulesToInclude | ForEach-Object {
        $workflowFileName = Get-PipelineFileName -ResourceIdentifier $_
        return ".github/workflows/$workflowFileName"
    }

    $baseInputObject = @{
        PersonalAccessToken   = $PersonalAccessToken
        GitHubRepositoryOwner = $GitHubRepositoryOwner
        GitHubRepositoryName  = $GitHubRepositoryName
    }

    Write-Verbose 'Fetching current GitHub workflows' -Verbose
    $workflows = Get-GitHubModuleWorkflowList @baseInputObject

    # Filter workflows
    $filteredWorkflows = $workflows | Where-Object { $relevantWorkflowPaths -contains $_.path }

    $gitHubWorkflowBadges = [System.Collections.ArrayList]@()

    Write-Verbose "Triggering GitHub workflows for branch [$TargetBranch]" -Verbose
    foreach ($workflow in $filteredWorkflows) {

        $workflowName = $workflow.name
        $workflowFilePath = $workflow.path
        $WorkflowFileName = Split-Path $Workflow.path -Leaf

        if (Test-Path (Join-Path $RepositoryRoot $workflowFilePath)) {
            if ($PSCmdlet.ShouldProcess("GitHub workflow [$WorkflowFileName] for branch [$TargetBranch]", 'Invoke')) {
                $null = Invoke-GitHubWorkflow @baseInputObject -TargetBranch $TargetBranch -WorkflowFilePath (Join-Path $RepositoryRoot $workflowFilePath) -GitHubPipelineInputs $GitHubPipelineInputs
            }
        } else {
            Write-Warning ('Warning: Workflow [{0}] is registered, but no workflow file in the target branch [{1}] available' -f (Join-Path $RepositoryRoot $workflowFilePath), $TargetBranch) -Verbose
        }

        # Generate pipeline badges
        $encodedBranch = [uri]::EscapeDataString($TargetBranch)
        $workflowUrl = "https://github.com/$GitHubRepositoryOwner/$GitHubRepositoryName/actions/workflows/$workflowFileName"

        $gitHubWorkflowBadges += "[![$workflowName]($workflowUrl/badge.svg?branch=$encodedBranch)]($workflowUrl)"

    }

    if ($gitHubWorkflowBadges.Count -gt 0) {
        Write-Verbose 'GitHub Workflow Badges' -Verbose
        Write-Verbose '======================' -Verbose
        Write-Verbose ($gitHubWorkflowBadges | Sort-Object | Out-String) -Verbose
    }

}

Set-ManualContent
Set-GeneratedContent
if (-not [String]::IsNullOrEmpty($PersonalAccessToken)) {
    Invoke-WorkflowList -PersonalAccessToken $PersonalAccessToken -TargetBranch $TargetBranch
}

Activity

  1. changed the title [-]Align to Role Assignments specs[/-] [+]Align to Role Assignments AVM specs[/+] on Oct 21, 2023
  2. added
    enhancement
    [cat] testing
    on Oct 21, 2023
  3. moved this from Needs triage to Done in Backlogon Oct 22, 2023
  4. moved this from Done to To do in Backlogon Oct 22, 2023
  5. moved this from To do to In progress in Backlogon Oct 22, 2023
  6. moved this from In progress to Ready for review in Backlogon Oct 22, 2023
  7. moved this from Ready for review to Done in Backlogon Oct 22, 2023
  8. moved this from Done to To do in Backlogon Oct 22, 2023
  9. moved this from To do to Done in Backlogon Oct 22, 2023
  10. moved this from Done to To do in Backlogon Oct 23, 2023
  11. moved this from To do to In progress in Backlogon Oct 23, 2023
  12. moved this from In progress to Done in Backlogon Oct 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

[cat] modules[cat] testingenhancement

Type

No type

Projects

  • Status
    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions