[WIP] add check to see if release notes was modified #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | | |
$minVersion = [Version]"1.0.0" # TBD | |
$csprojPath = ".\src\WebJobs.Extensions.DurableTask\WebJobs.Extensions.DurableTask.csproj" | |
# Parse the .csproj file to find the <MajorVersion> element | |
[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 | |
# Compare the project version to the minimum required version | |
if ($projectVersion -lt $minVersion) { | |
Write-Error "Project version ($projectVersion) is less than the minimum required version ($minVersion)." | |
exit 1 | |
} else { | |
Write-Host "Project version ($projectVersion) meets the minimum required version ($minVersion)." | |
} |