[ci] Only sign and push on release branches (#12531)

The `templates/release/vs-insertion-prep.yml` template which includes
package signing and feed publishing should only run against official
branches.  The condition has been updated to check the branch name for
`main` or `release/` before running.
This commit is contained in:
Peter Collins 2021-08-25 05:56:09 -04:00 коммит произвёл GitHub
Родитель fa4689b533
Коммит 4d2c4a7350
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -257,8 +257,8 @@ stages:
xqaCertPass: $(xqa--certificates--password)
enableDotnet: ${{ parameters.enableDotnet }}
# .NET 6 Release Prep and VS Insertion Stages, only execute them when the build reason is not a PR or a schedule build from OneLoc
- ${{ if and(ne(variables['Build.Reason'], 'Schedule'), or(eq(variables['Build.Reason'], 'IndividualCI'), eq(variables['Build.Reason'], 'Manual'))) }}:
# .NET 6 Release Prep and VS Insertion Stages, only execute them when the build comes from an official branch and is not a schedule build from OneLoc
- ${{ if and(ne(variables['Build.Reason'], 'Schedule'), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'), startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'))) }}:
- template: templates/release/vs-insertion-prep.yml
# Test stages