diff --git a/pipelines/docs-permissions.yml b/pipelines/docs-permissions.yml index 1b90e88ba..137798ac3 100644 --- a/pipelines/docs-permissions.yml +++ b/pipelines/docs-permissions.yml @@ -6,8 +6,8 @@ trigger: none pr: none schedules: - - cron: "0 9 * * 2" - displayName: Weekly Tuesday graph docs permissions updates + - cron: "0 11 * * 1-5" + displayName: Every weekday MS Graph docs permissions tables updates branches: include: - master @@ -61,10 +61,16 @@ steps: - pwsh: | # override branch prefix incase the run is manually triggered - $branchPrefix = if ($env:BUILD_REASON -eq 'Manual') { "preview-permissions-table-update" } else { "permissions-table-update" } + $branchPrefix = if ($env:BUILD_REASON -eq 'Manual') { "preview-permissions-tables-update" } else { "permissions-tables-update" } Write-Host "##vso[task.setvariable variable=branchPrefix]$branchPrefix" Write-Host "Branch prefix is $branchPrefix" displayName: 'Evaluate branch prefix to use' + +- pwsh: | + # set commit message to use when there are changes to push + $commitMessage = "Update generated permissions tables with build $env:BUILD_BUILDID" + Write-Host "##vso[task.setvariable variable=commitMessage]$commitMessage" + displayName: 'Set commit message to use' - template: templates/git-config.yml diff --git a/pipelines/templates/commit-changes.yml b/pipelines/templates/commit-changes.yml index 9715d61ba..d2dbd9454 100644 --- a/pipelines/templates/commit-changes.yml +++ b/pipelines/templates/commit-changes.yml @@ -7,13 +7,21 @@ steps: Write-Host "No changes to commit." -ForegroundColor Green } else { git add . | Write-Host + + # Set commit message + $commitMessage = $env:COMMITMESSAGE + if ([string]::IsNullOrWhiteSpace($commitMessage)) + { + $commitMessage = "Update generated files with build $env:BUILD_BUILDID" + } + if ($env:BUILD_REASON -eq 'Manual') # Skip CI if manually running this pipeline. { - git commit -m "Update generated files with build $env:BUILD_BUILDID [skip ci]" | Write-Host + git commit -m "$commitMessage [skip ci]" | Write-Host } else { - git commit -m "Update generated files with build $env:BUILD_BUILDID" | Write-Host + git commit -m $commitMessage | Write-Host } Write-Host "Added and commited generated files." -ForegroundColor Green Write-Host "##vso[task.setvariable variable=shouldPushBranch]true"