From 713e2238496f6ccb0cece0bb42f2d5a346efc97b Mon Sep 17 00:00:00 2001 From: AlexanderSehr Date: Thu, 8 Aug 2024 14:03:41 +0200 Subject: [PATCH] Added mgmtGroupId input to deployment removal pipelne --- .../workflows/platform.deployment.history.cleanup.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/platform.deployment.history.cleanup.yml b/.github/workflows/platform.deployment.history.cleanup.yml index 7b9d5011e2..6a5ff5b6ed 100644 --- a/.github/workflows/platform.deployment.history.cleanup.yml +++ b/.github/workflows/platform.deployment.history.cleanup.yml @@ -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 * * *" @@ -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 }}' }