Skip to content

Commit

Permalink
feat: add doNotMergeWithLastModuleIndexJsonFileVersion flexibility to…
Browse files Browse the repository at this point in the history
… workflow (#2720)

## Description

Following on from #2711 it was overlooked that the merge capability
would mean that even though the changes made in #2711 worked the merged
`moudleIndex.json` does not contain the correctly ordered list.

Therefore adding this to introduce the capability to invoke the
`doNotMergeWithLastModuleIndexJsonFileVersion` parameter input for the
workflow so we can use in scenarios like this to overwrite whatever is
in the `moduleIndex.json` and create it from scratch if needed, like
now.

## Type of Change

<!-- Use the checkboxes [x] on the options that are relevant. -->

- [x] Update to CI Environment or utilities (Non-module affecting
changes)
- [ ] Azure Verified Module updates:
- [ ] Bugfix containing backwards-compatible bug fixes, and I have NOT
bumped the MAJOR or MINOR version in `version.json`:
- [ ] Someone has opened a bug report issue, and I have included "Closes
#{bug_report_issue_number}" in the PR description.
- [ ] The bug was found by the module author, and no one has opened an
issue to report it yet.
- [ ] Feature update backwards compatible feature updates, and I have
bumped the MINOR version in `version.json`.
- [ ] Breaking changes and I have bumped the MAJOR version in
`version.json`.
  - [ ] Update to documentation

## Checklist

- [x] I'm sure there are no other open Pull Requests for the same
update/change
- [ ] I have run `Set-AVMModule` locally to generate the supporting
module files.
- [x] My corresponding pipelines / checks run clean and green without
any errors or warnings

<!-- Please keep up to date with the contribution guide at
https://aka.ms/avm/contribute/bicep -->
  • Loading branch information
jtracey93 authored Jul 17, 2024
1 parent 9ce1720 commit 59c21dc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/platform.publish-module-index-json.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ on:
schedule:
- cron: 45 11 * * * # Run daily at 3:45 AM PST
workflow_dispatch:
inputs:
regenIndexFromBRM:
type: boolean
description: "regenIndexFromBRM | Regenerate the moduleIndex.json file from scratch based on what is in BRM at the time of the run, instead of integrating it with its previous version."
required: false
default: false

permissions:
id-token: write
Expand Down Expand Up @@ -49,10 +55,14 @@ jobs:
ErrorAction = 'Continue'
}
Write-Verbose "Invoke task with" -Verbose
if ('${{ (fromJson(inputs.regenIndexFromBRM)) }}' -eq $true ) {
$functionInput['doNotMergeWithLastModuleIndexJsonFileVersion'] = $true
}
Write-Verbose 'Invoke task with' -Verbose
Write-Verbose ($functionInput | ConvertTo-Json | Out-String) -Verbose
if(-not (Invoke-AvmJsonModuleIndexGeneration @functionInput)) {
if (-not (Invoke-AvmJsonModuleIndexGeneration @functionInput)) {
Write-Output ('{0}={1}' -f 'anyErrorsOccurred', $true) >> $env:GITHUB_ENV
}
Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@
"files.insertFinalNewline": true,
"editor.detectIndentation": false // VS Code will not detect indentation/tab/space from the file and use settings editor.insertSpaces and editor.tabSize instead
}
}
}

0 comments on commit 59c21dc

Please sign in to comment.