diff --git a/.github/workflows/aoe-cd-dev.yml b/.github/workflows/aoe-cd-dev.yml index c839be52e..fc2f22966 100644 --- a/.github/workflows/aoe-cd-dev.yml +++ b/.github/workflows/aoe-cd-dev.yml @@ -4,6 +4,8 @@ on: push: branches: - dev + paths: + - 'src/optimization-engine/**' permissions: id-token: write contents: read diff --git a/.github/workflows/aoe-cd-prod.yml b/.github/workflows/aoe-cd-prod.yml index 47181b3fe..1abe8baf0 100644 --- a/.github/workflows/aoe-cd-prod.yml +++ b/.github/workflows/aoe-cd-prod.yml @@ -4,6 +4,8 @@ on: push: branches: - main + paths: + - 'src/optimization-engine/**' permissions: id-token: write contents: read diff --git a/.github/workflows/aoe-cd-test.yml b/.github/workflows/aoe-cd-test.yml index c189c4f49..b9404d4f4 100644 --- a/.github/workflows/aoe-cd-test.yml +++ b/.github/workflows/aoe-cd-test.yml @@ -4,6 +4,8 @@ on: push: branches: - features/aoe + paths: + - 'src/optimization-engine/**' permissions: id-token: write contents: read diff --git a/src/templates/finops-hub/modules/scripts/Copy-FileToAzureBlob.ps1 b/src/templates/finops-hub/modules/scripts/Copy-FileToAzureBlob.ps1 index 91131cebe..0a19ddb5b 100644 --- a/src/templates/finops-hub/modules/scripts/Copy-FileToAzureBlob.ps1 +++ b/src/templates/finops-hub/modules/scripts/Copy-FileToAzureBlob.ps1 @@ -78,6 +78,21 @@ if (!$json) # Set values from inputs $json.scopes = $env:scopes.Split('|') | ForEach-Object { @{ 'scope' = $_ } } +if (!($json.retention)) +{ + # In case the retention object is not present in the settings.json file (versions before 0.4), add it with default values + $retention = @" + { + "msexports": { + "days": 0 + }, + "ingestion": { + "months": 13 + } + } +"@ + $json | Add-Member -Name retention -Value (ConvertFrom-Json $retention) -MemberType NoteProperty +} $json.retention.msexports.days = [Int32]::Parse($env:msexportRetentionInDays) $json.retention.ingestion.months = [Int32]::Parse($env:ingestionRetentionInMonths)