Skip to content

[WIP] add check to see if release notes was modified #5

[WIP] add check to see if release notes was modified

[WIP] add check to see if release notes was modified #5

name: Guarantee WebJobs Extension version is correct
on:
workflow_dispatch:
push:
branches: [ main, dev, dajusto/validate-release-notes-are-provided ]
paths:
- '*'
pull_request:
branches: [ main, dev, dajusto/validate-release-notes-are-provided ]
paths:
- '.github/workflows/guarantee-release-notes.yml'
- '.github/workflows/guarantee-version-correctness.yml'
jobs:
build:
runs-on: ubuntu-latest
if: ${{ !contains(github.event.pull_request.labels.*.name, 'version-already-correct') }}
steps:
- uses: actions/checkout@v2
- name: Check .NET project version
shell: pwsh
run: |
$csprojPath = ".\src\WebJobs.Extensions.DurableTask\WebJobs.Extensions.DurableTask.csproj"
# Parse the .csproj file to reconstruct the version
[xml]$csproj = Get-Content -Path $csprojPath
$majorVersionString = $csproj.Project.PropertyGroup.MajorVersion
$minorVersionString = $csproj.Project.PropertyGroup.MinorVersion
$patchVersionString = $csproj.Project.PropertyGroup.PatchVersion
$version = "$majorVersionString.$minorVersionString.$patchVersionString"
$projectVersion = [Version]$version
# Obtain latest tag
git fetch --tags
$latestTag = git describe --tags $(git rev-list --tags --max-count=1)
Write-Output "Latest tag in the repository is $latestTag"
$latestTag = $latestTag.TrimStart('v')
$minVersion = [Version]$latestTag
# Split the version number by '.' character
$versionParts = $latestTag -split '\.'
# decompose the tag
$tagMajor = $versionParts[0]
$tagMinor = $versionParts[1]
$tagPatch = $versionParts[2]
# 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)."
exit 1
} else {
Write-Host "WebJobs extension version ($projectVersion) meets the minimum required version ($minVersion)."
}
- name: Check minorVersion
shell: pwsh
run: |
# 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)."
exit 1
} else {
Write-Host "WebJobs extension version ($projectVersion) meets the minimum required version ($minVersion)."
}