Skip to content

Commit

Permalink
Added mgmtGroupId input to deployment removal pipelne
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderSehr committed Aug 8, 2024
1 parent 4dcf058 commit 713e223
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion .github/workflows/platform.deployment.history.cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ on:
description: "The number of days to keep deployments with status [failed]" # 'Running' are always excluded
required: false
default: "14"
customManagementGroupId:
type: string
description: "The ID of the management group. Defaults to the default AVM group" # 'Running' are always excluded
required: false
default: ""
schedule:
- cron: "0 0 * * *"

Expand Down Expand Up @@ -114,8 +119,10 @@ jobs:
# Load used functions
. (Join-Path $env:GITHUB_WORKSPACE 'avm' 'utilities' 'pipelines' 'platform' 'deploymentRemoval' 'Clear-ManagementGroupDeploymentHistory.ps1')
$mgmtGroupIdInput = '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).customManagementGroupId }}'
$functionInput = @{
ManagementGroupId = '${{ secrets.ARM_MGMTGROUP_ID }}'
ManagementGroupId = [String]::IsNullOrEmpty($mgmtGroupIdInput) ? '${{ secrets.ARM_MGMTGROUP_ID }}' : $mgmtGroupIdInput
maxDeploymentRetentionInDays = '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).maxDeploymentRetentionInDays }}'
}
Expand Down

0 comments on commit 713e223

Please sign in to comment.