19
19
if : ${{ !contains(github.event.pull_request.labels.*.name, 'version-already-correct') }}
20
20
steps :
21
21
- uses : actions/checkout@v2
22
-
23
- - name : Check .NET project version
22
+ - name : Ensure a label is provided
23
+ if : ${{ !contains(github.event.pull_request.labels.*.name, 'major-pr') }} &&
24
+ ${{ !contains(github.event.pull_request.labels.*.name, 'minor-pr') }} &&
25
+ ${{ !contains(github.event.pull_request.labels.*.name, 'patch-pr') }} &&
26
+ shell : pwsh
27
+ run : |
28
+ $errorMessage = "This PR does not include either the 'major-pr', 'minor-pr', or 'patch-pr' labels, "+
29
+ "which correspond to whether this change warrants a major, minor, or patch version increase over the "+
30
+ "last release, nor does it include a 'version-already-correct' label, indicating the WebJobs extension "+
31
+ "version is correct as-is. Label this PR with one of those four labels to proceed."
32
+ Write-Error $errorMessage
33
+ - name : Obtain version in csproj and version of latest tag
24
34
shell : pwsh
25
35
run : |
26
36
$csprojPath = ".\src\WebJobs.Extensions.DurableTask\WebJobs.Extensions.DurableTask.csproj"
@@ -74,16 +84,42 @@ jobs:
74
84
if : ${{ !contains(github.event.pull_request.labels.*.name, 'patch-pr') }}
75
85
shell : pwsh
76
86
run : |
77
- $tagPatch = $env:TAG_PATCH
78
- $projPatch = $env:PROJ_PATCH
79
-
80
87
# Compare the project version to the minimum required version
81
- if ($projPatch -lt $tagPatch ) {
88
+ if ($env:PROJ_PATCH -lt $env:TAG_PATCH ) {
82
89
$errorMessage = "WebJobs extension version ($env:PROJ_VERSION) it not" +
83
90
"a patch-release greater than the latest tag version ($env:MIN_VERSION)." +
84
91
"Please increment the patch version or remove the `patch-pr` label."
85
92
Write-Error $errorMessage
86
93
exit 1
87
94
} else {
88
95
Write-Host "WebJobs extension version ($env:PROJ_VERSION) at least a patch-release greater than the latest tag version ($env:MIN_VERSION)."
96
+ }
97
+ - name : Check minorVersion
98
+ if : ${{ !contains(github.event.pull_request.labels.*.name, 'minor-pr') }}
99
+ shell : pwsh
100
+ run : |
101
+ # Ensure that csproj is at least one minor version greater than the last release
102
+ if ($env:PROJ_MINOR -lt $env:TAG_MINOR) {
103
+ $errorMessage = "WebJobs extension version ($env:PROJ_VERSION) it not" +
104
+ "a patch-release greater than the latest tag version ($env:MIN_VERSION)." +
105
+ "Please increment the patch version or remove the `patch-pr` label."
106
+ Write-Error $errorMessage
107
+ exit 1
108
+ } else {
109
+ Write-Host "WebJobs extension version ($env:PROJ_VERSION) at least a patch-release greater than the latest tag version ($env:MIN_VERSION)."
110
+ }
111
+
112
+ - name : Check majorVersion
113
+ if : ${{ !contains(github.event.pull_request.labels.*.name, 'major-pr') }}
114
+ shell : pwsh
115
+ run : |
116
+ # Ensure that csproj is at least one major version greater than the last release
117
+ if ($env:PROJ_MAJOR -lt $env:TAG_MAJOR) {
118
+ $errorMessage = "WebJobs extension version ($env:PROJ_VERSION) it not" +
119
+ "a major-release greater than the latest tag version ($env:MIN_VERSION)." +
120
+ "Please increment the patch version or remove the `patch-pr` label."
121
+ Write-Error $errorMessage
122
+ exit 1
123
+ } else {
124
+ Write-Host "WebJobs extension version ($env:PROJ_VERSION) at least a patch-release greater than the latest tag version ($env:MIN_VERSION)."
89
125
}
0 commit comments