Skip to content

Commit

Permalink
check patch
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmrdavid authored Apr 11, 2024
1 parent 1267c75 commit 9e7b7db
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions .github/workflows/guarantee-version-correctness.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,15 @@ jobs:
$tagMajor = $versionParts[0]
$tagMinor = $versionParts[1]
$tagPatch = $versionParts[2]
# Set version components as environment variables for future use
echo "TAG_MAJOR=$($versionParts[0])" | Out-File -Append -FilePath $Env:GITHUB_ENV
echo "TAG_MINOR=$($versionParts[1])" | Out-File -Append -FilePath $Env:GITHUB_ENV
echo "TAG_PATCH=$($versionParts[2])" | Out-File -Append -FilePath $Env:GITHUB_ENV
echo "PROJ_MAJOR=$($tagMajor)" | Out-File -Append -FilePath $Env:GITHUB_ENV
echo "PROJ_MINOR=$($tagMinor)" | Out-File -Append -FilePath $Env:GITHUB_ENV
echo "PROJ_PATCH=$($tagPatch)" | Out-File -Append -FilePath $Env:GITHUB_ENV
# Compare the project version to the minimum required version
if ($projectVersion -lt $minVersion) {
Expand All @@ -56,13 +65,17 @@ jobs:
} else {
Write-Host "WebJobs extension version ($projectVersion) meets the minimum required version ($minVersion)."
}
- name: Check minorVersion
if: ${{ contains(github.event.pull_request.labels.*.name, 'version-already-correct') }}
if: ${{ contains(github.event.pull_request.labels.*.name, 'patch-pr') }}
shell: pwsh
run: |
run: |
$tagPatch = $env:TAG_PATCH
$projPatch = $env:PROJ_PATCH
# Compare the project version to the minimum required version
if ($projectVersion -lt $minVersion) {
Write-Error "WebJobs extension version ($projectVersion) is less than the minimum required version ($minVersion)."
if ($projPatch -lt $tagPatch) {
Write-Error "PR was labeled with the 'patch-pr' label, but the `<PatchVersion>` element in the csproj ($projPatch) is less than `<PatchVersion>` of the last release tag ($tagPatch)."
exit 1
} else {
Write-Host "WebJobs extension version ($projectVersion) meets the minimum required version ($minVersion)."
Expand Down

0 comments on commit 9e7b7db

Please sign in to comment.