Skip to content

Commit

Permalink
Update to latest
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderSehr committed Dec 11, 2023
1 parent 362149d commit 3db259f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 256 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/platform.updateModuleRegistryTables.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
. (Join-Path $env:GITHUB_WORKSPACE 'utilities' 'tools' 'platform' 'Set-BicepModuleStatusBadgesTable.ps1')
$functionInput = @{
MarkdownFilePath = Join-Path $env:GITHUB_WORKSPACE 'docs' 'content' 'indexes' 'bicep' '_index.md'
MarkdownFilePath = Join-Path $env:GITHUB_WORKSPACE 'docs' 'static' 'module-features' 'bicepBadges.md'
ModulesRepoRootPath = Join-Path $env:GITHUB_WORKSPACE 'bicep-registry-modules'
ModulesFolderPath = Join-Path $env:GITHUB_WORKSPACE 'bicep-registry-modules' 'avm' 'res'
}
Expand All @@ -87,7 +87,7 @@ jobs:
. (Join-Path $env:GITHUB_WORKSPACE 'utilities' 'tools' 'platform' 'Set-BicepModulesFeatureCSV.ps1')
$functionInput = @{
CSVFilePath = Join-Path $env:GITHUB_WORKSPACE 'docs' 'static' 'module-features' 'bicepFeatures.csv
CSVFilePath = Join-Path $env:GITHUB_WORKSPACE 'docs' 'static' 'module-features' 'bicepFeatures.csv'
ModulesRepoRootPath = Join-Path $env:GITHUB_WORKSPACE 'bicep-registry-modules'
ModulesFolderPath = Join-Path $env:GITHUB_WORKSPACE 'bicep-registry-modules' 'avm'
}
Expand Down
20 changes: 7 additions & 13 deletions utilities/tools/platform/Set-BicepModuleStatusBadgesTable.ps1
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@

<#
.SYNOPSIS
Update the module features table in the given markdown file
Update the module features table in the given markdown file path
.DESCRIPTION
Update the module features table in the given markdown file
Update the module features table in the given markdown file path
.PARAMETER markdownFilePath
Mandatory. The path to the markdown file to update.
Expand All @@ -16,9 +16,9 @@ Mandatory. The path to the modules folder.
Mandatory. The path to the root of the repository containing the modules.
.EXAMPLE
Set-BicepModuleStatusBadgesTable -markdownFilePath 'bicep-features-table.md' -ModulesFolderPath 'bicep-registry-modules/avm/res' -ModulesRepoRootPath 'bicep-registry-modules'
Set-BicepModuleStatusBadgesTable -markdownFilePath 'bicepBadges.md' -ModulesFolderPath 'bicep-registry-modules/avm/res' -ModulesRepoRootPath 'bicep-registry-modules'
Update the file 'bicep-features-table.md' based on the modules in path 'bicep-registry-modules/avm/res'
Update the file 'bicepBadges.md' based on the modules in path 'bicep-registry-modules/avm/res'
#>
function Set-BicepModuleStatusBadgesTable {

Expand All @@ -35,11 +35,7 @@ function Set-BicepModuleStatusBadgesTable {
)

# Load external functions
. (Join-Path $PSScriptRoot 'helper' 'Merge-FileWithNewContent.ps1')
. (Join-Path $PSScriptRoot 'helper' 'Get-ModulesFeatureOutline.ps1')

# Logic
$originalContentArray = Get-Content -Path $markdownFilePath

$functionInput = @{
ModulesFolderPath = $ModulesFolderPath
Expand All @@ -48,16 +44,14 @@ function Set-BicepModuleStatusBadgesTable {
OnlyTopLevel = $true
ColumnsToInclude = @( 'Status' )
}
$featureTableString = Get-ModulesFeatureOutline @functionInput -Verbose

$newContent = Merge-FileWithNewContent -oldContent $originalContentArray -newContent $featureTableString.TrimEnd() -sectionStartIdentifier '# Feature table' -contentType 'table'
$badgesMarkdown = Get-ModulesFeatureOutline @functionInput -Verbose

Write-Verbose 'New content:'
Write-Verbose '============'
Write-Verbose ($newContent | Out-String)
Write-Verbose ($badgesMarkdown | Out-String)

if ($PSCmdlet.ShouldProcess("File in path [$markdownFilePath]", 'Overwrite')) {
Set-Content -Path $markdownFilePath -Value $newContent -Force
Set-Content -Path $markdownFilePath -Value $badgesMarkdown -Force
Write-Verbose "File [$markdownFilePath] updated" -Verbose
}
}
241 changes: 0 additions & 241 deletions utilities/tools/platform/helper/Merge-FileWithNewContent.ps1

This file was deleted.

0 comments on commit 3db259f

Please sign in to comment.