Skip to content

Commit 29469f0

Browse files
committed
Work CD-CI
- Replace pull request condition check. Signed-off-by: José Simões <[email protected]>
1 parent 293563d commit 29469f0

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

azure-pipelines.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -73,23 +73,23 @@ steps:
7373
inputs:
7474
versionSpec: '>= 2.4'
7575
addToPath: true
76-
condition: and( succeeded(), ne(variables['Build.Reason'], 'PullRequest') )
76+
condition: and( succeeded(), not( contains(variables['Build.SourceBranchName'], 'pull') ) )
7777
displayName: Setup Ruby
7878

7979
# generate change log including future version
8080
- powershell: |
8181
gem install github_changelog_generator --quiet --no-ri --no-rdoc
8282
# need to call it passing both cache options with full path otherwise it won't work
8383
github_changelog_generator --token $(GitHubToken) --cache-log $env:AGENT_TEMPDIRECTORY\github-changelog-logger.log --cache-file $env:AGENT_TEMPDIRECTORY\github-changelog-http-cache
84-
condition: and( succeeded(), ne(variables['Build.Reason'], 'PullRequest'), not( contains(variables['Build.SourceBranchName'], 'tags') ), or( eq(variables['Build.SourceBranchName'], 'master'), contains(variables['Build.SourceBranchName'], 'release') ) )
84+
condition: and( succeeded(), not( contains(variables['Build.SourceBranchName'], 'pull') ), not( contains(variables['Build.SourceBranchName'], 'tags') ), or( eq(variables['Build.SourceBranchName'], 'master'), contains(variables['Build.SourceBranchName'], 'release') ) )
8585
displayName: Generate change log
8686

8787
# generate change log including future version
8888
- powershell: |
8989
gem install github_changelog_generator --quiet --no-ri --no-rdoc
9090
# need to call it passing both cache options with full path otherwise it won't work
9191
github_changelog_generator --token $(GitHubToken) --cache-log $env:AGENT_TEMPDIRECTORY\github-changelog-logger.log --cache-file $env:AGENT_TEMPDIRECTORY\github-changelog-http-cache --future-release v$env:MY_NUGET_VERSION
92-
condition: and( succeeded(), ne(variables['Build.Reason'], 'PullRequest'), not( contains(variables['Build.SourceBranchName'], 'tags') ), not( or( eq(variables['Build.SourceBranchName'], 'master'), contains(variables['Build.SourceBranchName'], 'release') ) ) )
92+
condition: and( succeeded(), not( contains(variables['Build.SourceBranchName'], 'pull') ), not( contains(variables['Build.SourceBranchName'], 'tags') ), not( or( eq(variables['Build.SourceBranchName'], 'master'), contains(variables['Build.SourceBranchName'], 'release') ) ) )
9393
displayName: Generate change log
9494

9595
# copy change log to artifacts directory
@@ -98,7 +98,7 @@ steps:
9898
SourceFolder: '$(System.DefaultWorkingDirectory)'
9999
Contents: 'CHANGELOG.md'
100100
TargetFolder: '$(Build.ArtifactStagingDirectory)'
101-
condition: and( succeeded(), ne(variables['Build.Reason'], 'PullRequest') )
101+
condition: and( succeeded(), not( contains(variables['Build.SourceBranchName'], 'pull') ) )
102102
displayName: Copy Changelog
103103

104104
# push new changelog to GitHub repo
@@ -108,7 +108,7 @@ steps:
108108
# need to wrap the git command bellow so it doesn't throw an error because of redirecting the output to stderr
109109
git push origin "HEAD:$(Build.SourceBranchName)" --porcelain
110110
workingDirectory: $(System.DefaultWorkingDirectory)
111-
condition: and( succeeded(), ne(variables['Build.Reason'], 'PullRequest'), not( contains(variables['Build.SourceBranchName'], 'tags') ) )
111+
condition: and( succeeded(), not( contains(variables['Build.SourceBranchName'], 'pull') ), not( contains(variables['Build.SourceBranchName'], 'tags') ) )
112112
displayName: Push changelog to GitHub
113113

114114
# update could build number (only possible if this is not a PR from a fork)
@@ -168,7 +168,7 @@ steps:
168168
nuGetFeedType: external
169169
packagesToPush: '$(Build.ArtifactStagingDirectory)/$(nugetPackageName).nupkg;!$(Build.ArtifactStagingDirectory)/$(nugetPackageName).symbols.nupkg'
170170
publishFeedCredentials: 'NuGet'
171-
condition: and( succeeded(), ne(variables['Build.Reason'], 'PullRequest'), contains(variables['Build.SourceBranchName'], 'tags') )
171+
condition: and( succeeded(), not( contains(variables['Build.SourceBranchName'], 'pull') ), contains(variables['Build.SourceBranchName'], 'tags') )
172172
displayName: Push NuGet packages to NuGet
173173

174174
# step from template @ nf-tools repo

0 commit comments

Comments
 (0)