diff --git a/.github/actions/validate-deploy/action.yml b/.github/actions/validate-deploy/action.yml index 74985d6..73c6426 100644 --- a/.github/actions/validate-deploy/action.yml +++ b/.github/actions/validate-deploy/action.yml @@ -57,14 +57,16 @@ runs: - name: ${{ inputs.name }} shell: pwsh run: | + $Env:PSModulePath = $Env:PSModulePath, '$(modulesFolder)' -join [IO.Path]::PathSeparator + $CustomSortOrder = $Env:AZOPS_CUSTOM_SORT_ORDER -eq 'true' Import-PSFConfig -Path settings.json -Schema MetaJson -EnableException $RunWhatIf = -not ('${{inputs.deploy}}' -eq 'true') $diff = Get-Content -Path /tmp/diff.txt if(Test-Path -Path "/tmp/diffdeletedfiles.txt") { $diffdeletedfiles = Get-Content -Path /tmp/diffdeletedfiles.txt - Invoke-AzOpsPush -ChangeSet $diff -DeleteSetContents $diffdeletedfiles -WhatIf:$RunWhatIf + Invoke-AzOpsPush -ChangeSet $diff -DeleteSetContents $diffdeletedfiles -WhatIf:$RunWhatIf -CustomSortOrder:$CustomSortOrder } else { - Invoke-AzOpsPush -ChangeSet $diff -WhatIf:$RunWhatIf + Invoke-AzOpsPush -ChangeSet $diff -WhatIf:$RunWhatIf -CustomSortOrder:$CustomSortOrder } Get-Job | Remove-Job -Force diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index e22b070..9e467ac 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -38,6 +38,17 @@ env: AZOPS_MODULE_VERSION: ${{ secrets.AZOPS_MODULE_VERSION }} APPLICATIONINSIGHTS_CONNECTIONSTRING: ${{ secrets.APPLICATIONINSIGHTS_CONNECTIONSTRING }} + # + # customSortOrder + # Set to true to support custom sort order. + # When enabled, add a file named .order containing a list of + # file names and the files in that folder will be deployed in the + # order specified in the file. All files not listed in the file + # will be deployed after the files listed in the file. + # + + AZOPS_CUSTOM_SORT_ORDER: ${{ secrets.AZOPS_CUSTOM_SORT_ORDER }} + # # modulesFolder # To enable caching of PowerShell modules between diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 2a64198..5897cdd 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -34,6 +34,17 @@ env: AZOPS_MODULE_VERSION: ${{ secrets.AZOPS_MODULE_VERSION }} APPLICATIONINSIGHTS_CONNECTIONSTRING: ${{ secrets.APPLICATIONINSIGHTS_CONNECTIONSTRING }} + # + # customSortOrder + # Set to true to support custom sort order. + # When enabled, add a file named .order containing a list of + # file names and the files in that folder will be deployed in the + # order specified in the file. All files not listed in the file + # will be deployed after the files listed in the file. + # + + AZOPS_CUSTOM_SORT_ORDER: ${{ secrets.AZOPS_CUSTOM_SORT_ORDER }} + # # modulesFolder # To enable caching of PowerShell modules between