From c6eba39c45b3d1c0a3ae59a988ca653f3dc79d07 Mon Sep 17 00:00:00 2001 From: David Justo Date: Wed, 10 Apr 2024 18:36:52 -0700 Subject: [PATCH 01/38] add check to see if release notes was modified --- .github/workflows/guarantee-release-notes.yml | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/guarantee-release-notes.yml diff --git a/.github/workflows/guarantee-release-notes.yml b/.github/workflows/guarantee-release-notes.yml new file mode 100644 index 000000000..531c27246 --- /dev/null +++ b/.github/workflows/guarantee-release-notes.yml @@ -0,0 +1,35 @@ +name: Guarantee release notes are provided + +on: + workflow_dispatch: + push: + branches: [ main, dev ] + paths: + - 'src/**' + pull_request: + branches: [ main, dev ] + paths: + - 'src/**' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Check for release_notes.md changes + id: check_changes + run: | + echo "Checking for changes in release_notes.md..." + if git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep -q 'release_notes.md'; then + echo "release_notes.md was modified." + echo "MODIFIED=true" >> $GITHUB_ENV + else + echo "release_notes.md was NOT modified." + echo "MODIFIED=false" >> $GITHUB_ENV + + - name: Fail if release_notes.md was not modified + if: env.MODIFIED == 'false' + run: | + echo "Error: release_notes.md must be updated in this PR." + exit 1 \ No newline at end of file From 49501f7d75ca0e6ae5723fc32199e0b3417fa13a Mon Sep 17 00:00:00 2001 From: David Justo Date: Wed, 10 Apr 2024 18:40:29 -0700 Subject: [PATCH 02/38] add this branch for validation --- .github/workflows/guarantee-release-notes.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/guarantee-release-notes.yml b/.github/workflows/guarantee-release-notes.yml index 531c27246..0f2f359b7 100644 --- a/.github/workflows/guarantee-release-notes.yml +++ b/.github/workflows/guarantee-release-notes.yml @@ -3,7 +3,7 @@ name: Guarantee release notes are provided on: workflow_dispatch: push: - branches: [ main, dev ] + branches: [ main, dev, dajusto/validate-release-notes-are-provided ] paths: - 'src/**' pull_request: From 53a4ca93e71f1d1c500befb6f9dffa04e66e845c Mon Sep 17 00:00:00 2001 From: David Justo Date: Wed, 10 Apr 2024 18:41:41 -0700 Subject: [PATCH 03/38] relax constraints --- .github/workflows/guarantee-release-notes.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/guarantee-release-notes.yml b/.github/workflows/guarantee-release-notes.yml index 0f2f359b7..343d19944 100644 --- a/.github/workflows/guarantee-release-notes.yml +++ b/.github/workflows/guarantee-release-notes.yml @@ -9,7 +9,7 @@ on: pull_request: branches: [ main, dev ] paths: - - 'src/**' + - '*' jobs: build: From f37ca0784cf23419822eb0d21142648ed6b5a3b9 Mon Sep 17 00:00:00 2001 From: David Justo Date: Wed, 10 Apr 2024 18:42:56 -0700 Subject: [PATCH 04/38] relax constraints --- .github/workflows/guarantee-release-notes.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/guarantee-release-notes.yml b/.github/workflows/guarantee-release-notes.yml index 343d19944..30a707fc4 100644 --- a/.github/workflows/guarantee-release-notes.yml +++ b/.github/workflows/guarantee-release-notes.yml @@ -5,7 +5,7 @@ on: push: branches: [ main, dev, dajusto/validate-release-notes-are-provided ] paths: - - 'src/**' + - '*' pull_request: branches: [ main, dev ] paths: From cf5678f3b6c06e38a40296cb998cb29db017ecb6 Mon Sep 17 00:00:00 2001 From: David Justo Date: Wed, 10 Apr 2024 18:44:41 -0700 Subject: [PATCH 05/38] add yml --- .github/workflows/guarantee-release-notes.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/guarantee-release-notes.yml b/.github/workflows/guarantee-release-notes.yml index 30a707fc4..0ebac6664 100644 --- a/.github/workflows/guarantee-release-notes.yml +++ b/.github/workflows/guarantee-release-notes.yml @@ -9,7 +9,7 @@ on: pull_request: branches: [ main, dev ] paths: - - '*' + - '.github/workflows/guarantee-release-notes.yml' jobs: build: From a3401b42f8ffc15761aca9456e247fa739b4dbf8 Mon Sep 17 00:00:00 2001 From: David Justo Date: Wed, 10 Apr 2024 18:46:41 -0700 Subject: [PATCH 06/38] add empty line --- .github/workflows/guarantee-release-notes.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/guarantee-release-notes.yml b/.github/workflows/guarantee-release-notes.yml index 0ebac6664..080b04a9d 100644 --- a/.github/workflows/guarantee-release-notes.yml +++ b/.github/workflows/guarantee-release-notes.yml @@ -32,4 +32,4 @@ jobs: if: env.MODIFIED == 'false' run: | echo "Error: release_notes.md must be updated in this PR." - exit 1 \ No newline at end of file + exit 1 From 26f89c168704d4be3580ead13fc4ff789b4ec417 Mon Sep 17 00:00:00 2001 From: David Justo Date: Wed, 10 Apr 2024 18:49:46 -0700 Subject: [PATCH 07/38] close if-else-chain --- .github/workflows/guarantee-release-notes.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/guarantee-release-notes.yml b/.github/workflows/guarantee-release-notes.yml index 080b04a9d..ea767578c 100644 --- a/.github/workflows/guarantee-release-notes.yml +++ b/.github/workflows/guarantee-release-notes.yml @@ -27,7 +27,7 @@ jobs: else echo "release_notes.md was NOT modified." echo "MODIFIED=false" >> $GITHUB_ENV - + fi - name: Fail if release_notes.md was not modified if: env.MODIFIED == 'false' run: | From 5864e9322f38cf114ad5a67a0d9540caf90ea9d6 Mon Sep 17 00:00:00 2001 From: David Justo Date: Wed, 10 Apr 2024 18:51:05 -0700 Subject: [PATCH 08/38] change md --- release_notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/release_notes.md b/release_notes.md index bad0e4c62..330cbd46c 100644 --- a/release_notes.md +++ b/release_notes.md @@ -1,5 +1,6 @@ # Release Notes + ## Microsoft.Azure.Functions.Worker.Extensions.DurableTask 1.2.0 ### New Features From 3649ecba2c1a19f5f291e3e434a8a91c474cc915 Mon Sep 17 00:00:00 2001 From: David Justo Date: Wed, 10 Apr 2024 19:01:16 -0700 Subject: [PATCH 09/38] add labels check --- .github/workflows/guarantee-release-notes.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/guarantee-release-notes.yml b/.github/workflows/guarantee-release-notes.yml index ea767578c..a9a2c2e85 100644 --- a/.github/workflows/guarantee-release-notes.yml +++ b/.github/workflows/guarantee-release-notes.yml @@ -14,6 +14,7 @@ on: jobs: build: runs-on: ubuntu-latest + if: ${{ !contains(github.event.issue.labels.*.name, 'does-not-need-release-note') }} steps: - uses: actions/checkout@v2 From 4d0cf6c47cbcffeea8c712f81c09aa5aae3b48ab Mon Sep 17 00:00:00 2001 From: David Justo Date: Wed, 10 Apr 2024 19:02:24 -0700 Subject: [PATCH 10/38] add space --- .github/workflows/guarantee-release-notes.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/guarantee-release-notes.yml b/.github/workflows/guarantee-release-notes.yml index a9a2c2e85..ca552aee5 100644 --- a/.github/workflows/guarantee-release-notes.yml +++ b/.github/workflows/guarantee-release-notes.yml @@ -23,7 +23,7 @@ jobs: run: | echo "Checking for changes in release_notes.md..." if git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep -q 'release_notes.md'; then - echo "release_notes.md was modified." + echo "release_notes.md was modified. " echo "MODIFIED=true" >> $GITHUB_ENV else echo "release_notes.md was NOT modified." From dc563f41113704b95b9033a45056d4346ed14548 Mon Sep 17 00:00:00 2001 From: David Justo Date: Wed, 10 Apr 2024 19:03:27 -0700 Subject: [PATCH 11/38] add echo --- .github/workflows/guarantee-release-notes.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/guarantee-release-notes.yml b/.github/workflows/guarantee-release-notes.yml index ca552aee5..fef6f987e 100644 --- a/.github/workflows/guarantee-release-notes.yml +++ b/.github/workflows/guarantee-release-notes.yml @@ -32,5 +32,6 @@ jobs: - name: Fail if release_notes.md was not modified if: env.MODIFIED == 'false' run: | + echo {{github.event.issue.labels.*.name}} echo "Error: release_notes.md must be updated in this PR." exit 1 From 1e63f826e954138259d49b5dbc3fb1ff0a9e5b7f Mon Sep 17 00:00:00 2001 From: David Justo Date: Wed, 10 Apr 2024 19:07:15 -0700 Subject: [PATCH 12/38] change condition --- .github/workflows/guarantee-release-notes.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/guarantee-release-notes.yml b/.github/workflows/guarantee-release-notes.yml index fef6f987e..3122d64e7 100644 --- a/.github/workflows/guarantee-release-notes.yml +++ b/.github/workflows/guarantee-release-notes.yml @@ -14,7 +14,7 @@ on: jobs: build: runs-on: ubuntu-latest - if: ${{ !contains(github.event.issue.labels.*.name, 'does-not-need-release-note') }} + if: ${{ !contains(github.event.pull_request.labels.*.name, 'does-not-need-release-note') }} steps: - uses: actions/checkout@v2 @@ -32,6 +32,6 @@ jobs: - name: Fail if release_notes.md was not modified if: env.MODIFIED == 'false' run: | - echo {{github.event.issue.labels.*.name}} + echo {{github.event.pull_request.labels.*.name.*.name}} echo "Error: release_notes.md must be updated in this PR." exit 1 From 3fa67fd245cec388b18039b13a30a50f04a3dfae Mon Sep 17 00:00:00 2001 From: David Justo Date: Wed, 10 Apr 2024 19:49:24 -0700 Subject: [PATCH 13/38] make validation re-run on relabeling --- .github/workflows/guarantee-release-notes.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/guarantee-release-notes.yml b/.github/workflows/guarantee-release-notes.yml index 3122d64e7..190a40b82 100644 --- a/.github/workflows/guarantee-release-notes.yml +++ b/.github/workflows/guarantee-release-notes.yml @@ -10,6 +10,9 @@ on: branches: [ main, dev ] paths: - '.github/workflows/guarantee-release-notes.yml' + pull_request_target: + types: [labeled, unlabeled] + jobs: build: From 2eb8d6558622d2a003b05e5ea9bd926209ecc7e7 Mon Sep 17 00:00:00 2001 From: David Justo Date: Wed, 10 Apr 2024 19:54:11 -0700 Subject: [PATCH 14/38] remove pull_request_target --- .github/workflows/guarantee-release-notes.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/guarantee-release-notes.yml b/.github/workflows/guarantee-release-notes.yml index 190a40b82..3122d64e7 100644 --- a/.github/workflows/guarantee-release-notes.yml +++ b/.github/workflows/guarantee-release-notes.yml @@ -10,9 +10,6 @@ on: branches: [ main, dev ] paths: - '.github/workflows/guarantee-release-notes.yml' - pull_request_target: - types: [labeled, unlabeled] - jobs: build: From 49cc86048e1454414ccf3bf2aad630c812fcdcc7 Mon Sep 17 00:00:00 2001 From: David Justo Date: Wed, 10 Apr 2024 19:55:41 -0700 Subject: [PATCH 15/38] add labeling trigger --- .github/workflows/guarantee-release-notes.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/guarantee-release-notes.yml b/.github/workflows/guarantee-release-notes.yml index 3122d64e7..82eec9aac 100644 --- a/.github/workflows/guarantee-release-notes.yml +++ b/.github/workflows/guarantee-release-notes.yml @@ -7,9 +7,11 @@ on: paths: - '*' pull_request: - branches: [ main, dev ] + branches: [ main, dev, dajusto/validate-release-notes-are-provided ] paths: - '.github/workflows/guarantee-release-notes.yml' + pull_request: + types: [labeled, unlabeled] jobs: build: From 37523b8c02da8f7d7076d843057d93d41b81b478 Mon Sep 17 00:00:00 2001 From: David Justo Date: Wed, 10 Apr 2024 19:59:02 -0700 Subject: [PATCH 16/38] add labels again --- .github/workflows/guarantee-release-notes.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/guarantee-release-notes.yml b/.github/workflows/guarantee-release-notes.yml index 82eec9aac..84ab30669 100644 --- a/.github/workflows/guarantee-release-notes.yml +++ b/.github/workflows/guarantee-release-notes.yml @@ -8,10 +8,9 @@ on: - '*' pull_request: branches: [ main, dev, dajusto/validate-release-notes-are-provided ] + types: [labeled, unlabeled] paths: - '.github/workflows/guarantee-release-notes.yml' - pull_request: - types: [labeled, unlabeled] jobs: build: From 2ed6cf65c7a805607c0d541acec08b3c77f82d8d Mon Sep 17 00:00:00 2001 From: David Justo Date: Wed, 10 Apr 2024 20:12:55 -0700 Subject: [PATCH 17/38] add version correctness check --- .../guarantee-version-correctness.yml | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/guarantee-version-correctness.yml diff --git a/.github/workflows/guarantee-version-correctness.yml b/.github/workflows/guarantee-version-correctness.yml new file mode 100644 index 000000000..f3b7c9168 --- /dev/null +++ b/.github/workflows/guarantee-version-correctness.yml @@ -0,0 +1,46 @@ +name: Guarantee release notes are provided + +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 ] + types: [labeled, unlabeled] + 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 element + [xml]$csproj = Get-Content -Path $csprojPath + $projectVersionString = $csproj.Project.PropertyGroup.Version + if (-not $projectVersionString) { + Write-Error "Version tag not found in the .csproj file." + exit 1 + } + + $projectVersion = [Version]$projectVersionString + + # 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)." + } \ No newline at end of file From 789eaffe0993216f9be52efbeb8a02346560838f Mon Sep 17 00:00:00 2001 From: David Justo Date: Wed, 10 Apr 2024 20:16:25 -0700 Subject: [PATCH 18/38] rename proj --- .github/workflows/guarantee-version-correctness.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/guarantee-version-correctness.yml b/.github/workflows/guarantee-version-correctness.yml index f3b7c9168..05ef001d8 100644 --- a/.github/workflows/guarantee-version-correctness.yml +++ b/.github/workflows/guarantee-version-correctness.yml @@ -1,4 +1,4 @@ -name: Guarantee release notes are provided +name: Guarantee WebJobs Extension version is correct on: workflow_dispatch: @@ -25,7 +25,7 @@ jobs: shell: pwsh run: | $minVersion = [Version]"1.0.0" # TBD - $csprojPath = "..\src\WebJobs.Extensions.DurableTask\WebJobs.Extensions.DurableTask.csproj" + $csprojPath = ".\src\WebJobs.Extensions.DurableTask\WebJobs.Extensions.DurableTask.csproj" # Parse the .csproj file to find the element [xml]$csproj = Get-Content -Path $csprojPath From 6231ae676ac0195718ae20027f708fba4ffad096 Mon Sep 17 00:00:00 2001 From: David Justo Date: Wed, 10 Apr 2024 20:20:33 -0700 Subject: [PATCH 19/38] patch version constructor --- .../workflows/guarantee-version-correctness.yml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/guarantee-version-correctness.yml b/.github/workflows/guarantee-version-correctness.yml index 05ef001d8..59b19fdca 100644 --- a/.github/workflows/guarantee-version-correctness.yml +++ b/.github/workflows/guarantee-version-correctness.yml @@ -8,7 +8,6 @@ on: - '*' pull_request: branches: [ main, dev, dajusto/validate-release-notes-are-provided ] - types: [labeled, unlabeled] paths: - '.github/workflows/guarantee-release-notes.yml' - '.github/workflows/guarantee-version-correctness.yml' @@ -27,15 +26,14 @@ jobs: $minVersion = [Version]"1.0.0" # TBD $csprojPath = ".\src\WebJobs.Extensions.DurableTask\WebJobs.Extensions.DurableTask.csproj" - # Parse the .csproj file to find the element + # Parse the .csproj file to find the element [xml]$csproj = Get-Content -Path $csprojPath - $projectVersionString = $csproj.Project.PropertyGroup.Version - if (-not $projectVersionString) { - Write-Error "Version tag not found in the .csproj file." - exit 1 - } + $majorVersionString = $csproj.Project.PropertyGroup.MajorVersion + $minorVersionString = $csproj.Project.PropertyGroup.MinorVersion + $patchVersionString = $csproj.Project.PropertyGroup.PatchVersion + $version = "$majorVersionString.$minorVersionString.$patchVersionString" - $projectVersion = [Version]$projectVersionString + $projectVersion = [Version]$version # Compare the project version to the minimum required version if ($projectVersion -lt $minVersion) { From effa54f9ec607d6b7d969a2f805fff8ad1484315 Mon Sep 17 00:00:00 2001 From: David Justo Date: Wed, 10 Apr 2024 21:31:18 -0700 Subject: [PATCH 20/38] use latest tag --- .../guarantee-version-correctness.yml | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/.github/workflows/guarantee-version-correctness.yml b/.github/workflows/guarantee-version-correctness.yml index 59b19fdca..5fe04627d 100644 --- a/.github/workflows/guarantee-version-correctness.yml +++ b/.github/workflows/guarantee-version-correctness.yml @@ -23,17 +23,31 @@ jobs: - 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 element + # 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) { From 1fcc73f1065deb949d56b5241a90e60df77b853c Mon Sep 17 00:00:00 2001 From: David Justo Date: Wed, 10 Apr 2024 21:33:32 -0700 Subject: [PATCH 21/38] add minorVersion check --- .../workflows/guarantee-version-correctness.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/guarantee-version-correctness.yml b/.github/workflows/guarantee-version-correctness.yml index 5fe04627d..d17a8c29d 100644 --- a/.github/workflows/guarantee-version-correctness.yml +++ b/.github/workflows/guarantee-version-correctness.yml @@ -51,8 +51,18 @@ jobs: # 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)." + Write-Error "WebJobs extension version ($projectVersion) is less than the minimum required version ($minVersion)." exit 1 } else { - Write-Host "Project version ($projectVersion) meets the minimum required version ($minVersion)." + 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)." } \ No newline at end of file From 1267c7529678646a69cbb0071646d677c2a2c9d2 Mon Sep 17 00:00:00 2001 From: David Justo Date: Wed, 10 Apr 2024 21:34:32 -0700 Subject: [PATCH 22/38] make next step not run --- .github/workflows/guarantee-version-correctness.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/guarantee-version-correctness.yml b/.github/workflows/guarantee-version-correctness.yml index d17a8c29d..a57d19741 100644 --- a/.github/workflows/guarantee-version-correctness.yml +++ b/.github/workflows/guarantee-version-correctness.yml @@ -57,6 +57,7 @@ jobs: 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') }} shell: pwsh run: | # Compare the project version to the minimum required version From 9e7b7dbc0c164d6f70f4d7f9ece1248486b3a868 Mon Sep 17 00:00:00 2001 From: David Justo Date: Wed, 10 Apr 2024 21:42:49 -0700 Subject: [PATCH 23/38] check patch --- .../guarantee-version-correctness.yml | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/.github/workflows/guarantee-version-correctness.yml b/.github/workflows/guarantee-version-correctness.yml index a57d19741..6e861b453 100644 --- a/.github/workflows/guarantee-version-correctness.yml +++ b/.github/workflows/guarantee-version-correctness.yml @@ -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) { @@ -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 `` element in the csproj ($projPatch) is less than `` of the last release tag ($tagPatch)." exit 1 } else { Write-Host "WebJobs extension version ($projectVersion) meets the minimum required version ($minVersion)." From 81f17390cd28fc84a8588533b4487f0d3e157540 Mon Sep 17 00:00:00 2001 From: David Justo Date: Wed, 10 Apr 2024 21:49:14 -0700 Subject: [PATCH 24/38] test multi-line strs --- .github/workflows/guarantee-version-correctness.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/guarantee-version-correctness.yml b/.github/workflows/guarantee-version-correctness.yml index 6e861b453..d36e8995f 100644 --- a/.github/workflows/guarantee-version-correctness.yml +++ b/.github/workflows/guarantee-version-correctness.yml @@ -67,7 +67,7 @@ jobs: } - name: Check minorVersion - if: ${{ contains(github.event.pull_request.labels.*.name, 'patch-pr') }} + if: ${{ !contains(github.event.pull_request.labels.*.name, 'patch-pr') }} shell: pwsh run: | $tagPatch = $env:TAG_PATCH @@ -75,8 +75,11 @@ jobs: # Compare the project version to the minimum required version if ($projPatch -lt $tagPatch) { - Write-Error "PR was labeled with the 'patch-pr' label, but the `` element in the csproj ($projPatch) is less than `` of the last release tag ($tagPatch)." + $errorMessage = "WebJobs extension version ($projectVersion) it not" + + "a patch-release greater than the latest tag version ($minVersion)." + + "Please increment the patch version or remove the `patch-pr` label." + Write-Error $errorMessage exit 1 } else { - Write-Host "WebJobs extension version ($projectVersion) meets the minimum required version ($minVersion)." + Write-Host "WebJobs extension version ($projectVersion) at least a patch-release greater than the latest tag version ($minVersion)." } \ No newline at end of file From 416504dd69e6b7ebad237ea7c374b9ff3d21c952 Mon Sep 17 00:00:00 2001 From: David Justo Date: Wed, 10 Apr 2024 21:53:47 -0700 Subject: [PATCH 25/38] try setting env vars --- .github/workflows/guarantee-version-correctness.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/guarantee-version-correctness.yml b/.github/workflows/guarantee-version-correctness.yml index d36e8995f..45ff5a774 100644 --- a/.github/workflows/guarantee-version-correctness.yml +++ b/.github/workflows/guarantee-version-correctness.yml @@ -50,13 +50,13 @@ jobs: $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 + "TAG_MAJOR=$($versionParts[0])" | Out-File -Append -FilePath $Env:GITHUB_ENV + "TAG_MINOR=$($versionParts[1])" | Out-File -Append -FilePath $Env:GITHUB_ENV + "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 + "PROJ_MAJOR=$($tagMajor)" | Out-File -Append -FilePath $Env:GITHUB_ENV + "PROJ_MINOR=$($tagMinor)" | Out-File -Append -FilePath $Env:GITHUB_ENV + "PROJ_PATCH=$($tagPatch)" | Out-File -Append -FilePath $Env:GITHUB_ENV # Compare the project version to the minimum required version if ($projectVersion -lt $minVersion) { From f3ccaf8e8227f0daabc4fffeae66865a63618987 Mon Sep 17 00:00:00 2001 From: David Justo Date: Wed, 10 Apr 2024 21:55:26 -0700 Subject: [PATCH 26/38] test --- .github/workflows/guarantee-version-correctness.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/guarantee-version-correctness.yml b/.github/workflows/guarantee-version-correctness.yml index 45ff5a774..72d391659 100644 --- a/.github/workflows/guarantee-version-correctness.yml +++ b/.github/workflows/guarantee-version-correctness.yml @@ -72,7 +72,10 @@ jobs: run: | $tagPatch = $env:TAG_PATCH $projPatch = $env:PROJ_PATCH - + + Write-Host $tagPatch + Write-Host $env:TAG_PATCH + # Compare the project version to the minimum required version if ($projPatch -lt $tagPatch) { $errorMessage = "WebJobs extension version ($projectVersion) it not" + From a6430fbf85050206983be754b2870cf29face292 Mon Sep 17 00:00:00 2001 From: David Justo Date: Wed, 10 Apr 2024 21:58:37 -0700 Subject: [PATCH 27/38] improve message --- .github/workflows/guarantee-version-correctness.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/guarantee-version-correctness.yml b/.github/workflows/guarantee-version-correctness.yml index 72d391659..d3610d95b 100644 --- a/.github/workflows/guarantee-version-correctness.yml +++ b/.github/workflows/guarantee-version-correctness.yml @@ -32,6 +32,8 @@ jobs: $patchVersionString = $csproj.Project.PropertyGroup.PatchVersion $version = "$majorVersionString.$minorVersionString.$patchVersionString" $projectVersion = [Version]$version + "PROJ_VERSION=$projectVersion" | Out-File -Append -FilePath $Env:GITHUB_ENV + # Obtain latest tag git fetch --tags @@ -40,6 +42,8 @@ jobs: $latestTag = $latestTag.TrimStart('v') $minVersion = [Version]$latestTag + "MIN_VERSION=$minVersion" | Out-File -Append -FilePath $Env:GITHUB_ENV + # Split the version number by '.' character $versionParts = $latestTag -split '\.' @@ -73,13 +77,10 @@ jobs: $tagPatch = $env:TAG_PATCH $projPatch = $env:PROJ_PATCH - Write-Host $tagPatch - Write-Host $env:TAG_PATCH - # Compare the project version to the minimum required version if ($projPatch -lt $tagPatch) { - $errorMessage = "WebJobs extension version ($projectVersion) it not" + - "a patch-release greater than the latest tag version ($minVersion)." + + $errorMessage = "WebJobs extension version ($env:PROJ_VERSION) it not" + + "a patch-release greater than the latest tag version ($env:MIN_VERSION)." + "Please increment the patch version or remove the `patch-pr` label." Write-Error $errorMessage exit 1 From 7eca545a8a229fa8d98a15bf82e1842f88ac0dfc Mon Sep 17 00:00:00 2001 From: David Justo Date: Wed, 10 Apr 2024 22:00:11 -0700 Subject: [PATCH 28/38] improve err --- .github/workflows/guarantee-version-correctness.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/guarantee-version-correctness.yml b/.github/workflows/guarantee-version-correctness.yml index d3610d95b..07095a3e5 100644 --- a/.github/workflows/guarantee-version-correctness.yml +++ b/.github/workflows/guarantee-version-correctness.yml @@ -85,5 +85,5 @@ jobs: Write-Error $errorMessage exit 1 } else { - Write-Host "WebJobs extension version ($projectVersion) at least a patch-release greater than the latest tag version ($minVersion)." + Write-Host "WebJobs extension version ($env:PROJ_VERSION) at least a patch-release greater than the latest tag version ($env:MIN_VERSION)." } \ No newline at end of file From 59d57805e313e48dc23a7b360f23d907aa441fc0 Mon Sep 17 00:00:00 2001 From: David Justo Date: Wed, 10 Apr 2024 22:08:29 -0700 Subject: [PATCH 29/38] add label check --- .../guarantee-version-correctness.yml | 48 ++++++++++++++++--- 1 file changed, 42 insertions(+), 6 deletions(-) diff --git a/.github/workflows/guarantee-version-correctness.yml b/.github/workflows/guarantee-version-correctness.yml index 07095a3e5..282570b7c 100644 --- a/.github/workflows/guarantee-version-correctness.yml +++ b/.github/workflows/guarantee-version-correctness.yml @@ -19,8 +19,18 @@ jobs: if: ${{ !contains(github.event.pull_request.labels.*.name, 'version-already-correct') }} steps: - uses: actions/checkout@v2 - - - name: Check .NET project version + - name: Ensure a label is provided + if: ${{ !contains(github.event.pull_request.labels.*.name, 'major-pr') }} && + ${{ !contains(github.event.pull_request.labels.*.name, 'minor-pr') }} && + ${{ !contains(github.event.pull_request.labels.*.name, 'patch-pr') }} && + shell: pwsh + run: | + $errorMessage = "This PR does not include either the 'major-pr', 'minor-pr', or 'patch-pr' labels, "+ + "which correspond to whether this change warrants a major, minor, or patch version increase over the "+ + "last release, nor does it include a 'version-already-correct' label, indicating the WebJobs extension "+ + "version is correct as-is. Label this PR with one of those four labels to proceed." + Write-Error $errorMessage + - name: Obtain version in csproj and version of latest tag shell: pwsh run: | $csprojPath = ".\src\WebJobs.Extensions.DurableTask\WebJobs.Extensions.DurableTask.csproj" @@ -74,11 +84,8 @@ jobs: if: ${{ !contains(github.event.pull_request.labels.*.name, 'patch-pr') }} shell: pwsh run: | - $tagPatch = $env:TAG_PATCH - $projPatch = $env:PROJ_PATCH - # Compare the project version to the minimum required version - if ($projPatch -lt $tagPatch) { + if ($env:PROJ_PATCH -lt $env:TAG_PATCH) { $errorMessage = "WebJobs extension version ($env:PROJ_VERSION) it not" + "a patch-release greater than the latest tag version ($env:MIN_VERSION)." + "Please increment the patch version or remove the `patch-pr` label." @@ -86,4 +93,33 @@ jobs: exit 1 } else { Write-Host "WebJobs extension version ($env:PROJ_VERSION) at least a patch-release greater than the latest tag version ($env:MIN_VERSION)." + } + - name: Check minorVersion + if: ${{ !contains(github.event.pull_request.labels.*.name, 'minor-pr') }} + shell: pwsh + run: | + # Ensure that csproj is at least one minor version greater than the last release + if ($env:PROJ_MINOR -lt $env:TAG_MINOR) { + $errorMessage = "WebJobs extension version ($env:PROJ_VERSION) it not" + + "a patch-release greater than the latest tag version ($env:MIN_VERSION)." + + "Please increment the patch version or remove the `patch-pr` label." + Write-Error $errorMessage + exit 1 + } else { + Write-Host "WebJobs extension version ($env:PROJ_VERSION) at least a patch-release greater than the latest tag version ($env:MIN_VERSION)." + } + + - name: Check majorVersion + if: ${{ !contains(github.event.pull_request.labels.*.name, 'major-pr') }} + shell: pwsh + run: | + # Ensure that csproj is at least one major version greater than the last release + if ($env:PROJ_MAJOR -lt $env:TAG_MAJOR) { + $errorMessage = "WebJobs extension version ($env:PROJ_VERSION) it not" + + "a major-release greater than the latest tag version ($env:MIN_VERSION)." + + "Please increment the patch version or remove the `patch-pr` label." + Write-Error $errorMessage + exit 1 + } else { + Write-Host "WebJobs extension version ($env:PROJ_VERSION) at least a patch-release greater than the latest tag version ($env:MIN_VERSION)." } \ No newline at end of file From 61b3ea50cbdce089d3f261fc71cb4680b30a4ca9 Mon Sep 17 00:00:00 2001 From: David Justo Date: Wed, 10 Apr 2024 22:11:54 -0700 Subject: [PATCH 30/38] make validation run on labeled --- .github/workflows/guarantee-release-notes.yml | 4 +++- .github/workflows/guarantee-version-correctness.yml | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/guarantee-release-notes.yml b/.github/workflows/guarantee-release-notes.yml index 84ab30669..11d7157e8 100644 --- a/.github/workflows/guarantee-release-notes.yml +++ b/.github/workflows/guarantee-release-notes.yml @@ -8,9 +8,11 @@ on: - '*' pull_request: branches: [ main, dev, dajusto/validate-release-notes-are-provided ] - types: [labeled, unlabeled] paths: - '.github/workflows/guarantee-release-notes.yml' + pull_request: + branches: [ main, dev, dajusto/validate-release-notes-are-provided ] + types: [labeled, unlabeled] jobs: build: diff --git a/.github/workflows/guarantee-version-correctness.yml b/.github/workflows/guarantee-version-correctness.yml index 282570b7c..b5efe5261 100644 --- a/.github/workflows/guarantee-version-correctness.yml +++ b/.github/workflows/guarantee-version-correctness.yml @@ -11,7 +11,9 @@ on: paths: - '.github/workflows/guarantee-release-notes.yml' - '.github/workflows/guarantee-version-correctness.yml' - + pull_request: + branches: [ main, dev, dajusto/validate-release-notes-are-provided ] + types: [labeled, unlabeled] jobs: build: From 53051e19a6d7e03ceace50d9f1ace3b91be8cfbd Mon Sep 17 00:00:00 2001 From: David Justo Date: Wed, 10 Apr 2024 22:15:39 -0700 Subject: [PATCH 31/38] fix --- .github/workflows/guarantee-release-notes.yml | 4 +--- .github/workflows/guarantee-version-correctness.yml | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/guarantee-release-notes.yml b/.github/workflows/guarantee-release-notes.yml index 11d7157e8..126db0fe5 100644 --- a/.github/workflows/guarantee-release-notes.yml +++ b/.github/workflows/guarantee-release-notes.yml @@ -8,11 +8,9 @@ on: - '*' pull_request: branches: [ main, dev, dajusto/validate-release-notes-are-provided ] + types: [labeled, unlabeled, synchronize] paths: - '.github/workflows/guarantee-release-notes.yml' - pull_request: - branches: [ main, dev, dajusto/validate-release-notes-are-provided ] - types: [labeled, unlabeled] jobs: build: diff --git a/.github/workflows/guarantee-version-correctness.yml b/.github/workflows/guarantee-version-correctness.yml index b5efe5261..51350800a 100644 --- a/.github/workflows/guarantee-version-correctness.yml +++ b/.github/workflows/guarantee-version-correctness.yml @@ -8,12 +8,10 @@ on: - '*' pull_request: branches: [ main, dev, dajusto/validate-release-notes-are-provided ] + types: [labeled, unlabeled, synchronize] paths: - '.github/workflows/guarantee-release-notes.yml' - '.github/workflows/guarantee-version-correctness.yml' - pull_request: - branches: [ main, dev, dajusto/validate-release-notes-are-provided ] - types: [labeled, unlabeled] jobs: build: From 36d459d6c636fa363a0f61d5d815d5dee2acee3b Mon Sep 17 00:00:00 2001 From: David Justo Date: Wed, 10 Apr 2024 22:30:45 -0700 Subject: [PATCH 32/38] translate to pwsh --- .github/workflows/guarantee-release-notes.yml | 39 ++++++++++--------- 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/.github/workflows/guarantee-release-notes.yml b/.github/workflows/guarantee-release-notes.yml index 126db0fe5..b40a79cd4 100644 --- a/.github/workflows/guarantee-release-notes.yml +++ b/.github/workflows/guarantee-release-notes.yml @@ -1,4 +1,4 @@ -name: Guarantee release notes are provided +name: Check release_notes.md is updated on: workflow_dispatch: @@ -6,33 +6,36 @@ on: branches: [ main, dev, dajusto/validate-release-notes-are-provided ] paths: - '*' + pull_request: branches: [ main, dev, dajusto/validate-release-notes-are-provided ] - types: [labeled, unlabeled, synchronize] + types: [labeled, unlabeled, synchronize] # Trigger on PR labeling events, or a PR push (synchronize) paths: - '.github/workflows/guarantee-release-notes.yml' jobs: build: runs-on: ubuntu-latest - if: ${{ !contains(github.event.pull_request.labels.*.name, 'does-not-need-release-note') }} + # Skip all validation if label 'no-release-notes' is applied to the PR + if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-release-notes') }} steps: - uses: actions/checkout@v2 - - name: Check for release_notes.md changes + - name: Check `release_notes.md` id: check_changes + shell: pwsh run: | - echo "Checking for changes in release_notes.md..." - if git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep -q 'release_notes.md'; then - echo "release_notes.md was modified. " - echo "MODIFIED=true" >> $GITHUB_ENV - else - echo "release_notes.md was NOT modified." - echo "MODIFIED=false" >> $GITHUB_ENV - fi - - name: Fail if release_notes.md was not modified - if: env.MODIFIED == 'false' - run: | - echo {{github.event.pull_request.labels.*.name.*.name}} - echo "Error: release_notes.md must be updated in this PR." - exit 1 + Write-Host "Checking for changes in release_notes.md..." + $changedFiles = git diff --name-only ${{ github.event.before }} ${{ github.sha }} + + # If `release_notes.md` was modified, the PR passes the validation. + # If it's not modified, fail and instruct author on what to do (either modify it or add 'no-release-notes' label) + if ($changedFiles -match "release_notes.md") { + Write-Host "release_notes.md was modified. Pass!" + } else { + $errorMessage = "This PR does not update `release_notes.md`. If the PR should be included " + + "in the next release's release notes, please update this file. If the PR should not be included, " + + "then please add the label `no-release-notes` to the PR." + Write-Error #errorMessage + exit 1 # Fail the GH action + } \ No newline at end of file From fa03f72817ba71b849b50cc15a68b5b11c3a7e85 Mon Sep 17 00:00:00 2001 From: David Justo Date: Wed, 10 Apr 2024 22:37:28 -0700 Subject: [PATCH 33/38] comment the release notes action --- .github/workflows/guarantee-release-notes.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/guarantee-release-notes.yml b/.github/workflows/guarantee-release-notes.yml index b40a79cd4..dfa4e5268 100644 --- a/.github/workflows/guarantee-release-notes.yml +++ b/.github/workflows/guarantee-release-notes.yml @@ -25,8 +25,13 @@ jobs: id: check_changes shell: pwsh run: | + Write-Host "Checking for changes in release_notes.md..." - $changedFiles = git diff --name-only ${{ github.event.before }} ${{ github.sha }} + $latestCommitInPR= ${{ github.sha }} + $latestCommitInTargetBranch = ${{ github.event.before }} + + # Get list of files changed in this PR + $changedFiles = git diff --name-only latestCommitInTargetBranch $latestCommitInPR # If `release_notes.md` was modified, the PR passes the validation. # If it's not modified, fail and instruct author on what to do (either modify it or add 'no-release-notes' label) @@ -36,6 +41,6 @@ jobs: $errorMessage = "This PR does not update `release_notes.md`. If the PR should be included " + "in the next release's release notes, please update this file. If the PR should not be included, " + "then please add the label `no-release-notes` to the PR." - Write-Error #errorMessage + Write-Error $errorMessage exit 1 # Fail the GH action } \ No newline at end of file From 71106428ed803002b767ab6c1e14d4badbd3ad30 Mon Sep 17 00:00:00 2001 From: David Justo Date: Wed, 10 Apr 2024 22:40:39 -0700 Subject: [PATCH 34/38] add missing space --- .github/workflows/guarantee-release-notes.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/guarantee-release-notes.yml b/.github/workflows/guarantee-release-notes.yml index dfa4e5268..8e5809e9f 100644 --- a/.github/workflows/guarantee-release-notes.yml +++ b/.github/workflows/guarantee-release-notes.yml @@ -27,7 +27,7 @@ jobs: run: | Write-Host "Checking for changes in release_notes.md..." - $latestCommitInPR= ${{ github.sha }} + $latestCommitInPR = ${{ github.sha }} $latestCommitInTargetBranch = ${{ github.event.before }} # Get list of files changed in this PR From 983a94c4f11d7290ccc03e2ada01ed51271a5b61 Mon Sep 17 00:00:00 2001 From: David Justo Date: Wed, 10 Apr 2024 22:41:39 -0700 Subject: [PATCH 35/38] add quotes around strings --- .github/workflows/guarantee-release-notes.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/guarantee-release-notes.yml b/.github/workflows/guarantee-release-notes.yml index 8e5809e9f..5f70d9fd4 100644 --- a/.github/workflows/guarantee-release-notes.yml +++ b/.github/workflows/guarantee-release-notes.yml @@ -27,8 +27,8 @@ jobs: run: | Write-Host "Checking for changes in release_notes.md..." - $latestCommitInPR = ${{ github.sha }} - $latestCommitInTargetBranch = ${{ github.event.before }} + $latestCommitInPR = "${{ github.sha }}" + $latestCommitInTargetBranch = "${{ github.event.before }}" # Get list of files changed in this PR $changedFiles = git diff --name-only latestCommitInTargetBranch $latestCommitInPR From 48b4d70fd1ef9d166740e45c8cdd03704d766a1f Mon Sep 17 00:00:00 2001 From: David Justo Date: Wed, 10 Apr 2024 22:46:08 -0700 Subject: [PATCH 36/38] add more comments --- .github/workflows/guarantee-release-notes.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/guarantee-release-notes.yml b/.github/workflows/guarantee-release-notes.yml index 5f70d9fd4..233ccb009 100644 --- a/.github/workflows/guarantee-release-notes.yml +++ b/.github/workflows/guarantee-release-notes.yml @@ -27,6 +27,9 @@ jobs: run: | Write-Host "Checking for changes in release_notes.md..." + + # `github.sha` is documented here : https://docs.github.com/en/actions/learn-github-actions/contexts#github-context + # `github.event.before` is documented here (under "Webhook payload object for push"): https://docs.github.com/en/webhooks/webhook-events-and-payloads#push $latestCommitInPR = "${{ github.sha }}" $latestCommitInTargetBranch = "${{ github.event.before }}" From e6597f0844927fed5505e8a604eca64910bc371f Mon Sep 17 00:00:00 2001 From: David Justo Date: Wed, 10 Apr 2024 22:47:28 -0700 Subject: [PATCH 37/38] rename files --- .../{guarantee-release-notes.yml => release-notes-check.yml} | 0 .../{guarantee-version-correctness.yml => version-check.yml} | 3 ++- 2 files changed, 2 insertions(+), 1 deletion(-) rename .github/workflows/{guarantee-release-notes.yml => release-notes-check.yml} (100%) rename .github/workflows/{guarantee-version-correctness.yml => version-check.yml} (95%) diff --git a/.github/workflows/guarantee-release-notes.yml b/.github/workflows/release-notes-check.yml similarity index 100% rename from .github/workflows/guarantee-release-notes.yml rename to .github/workflows/release-notes-check.yml diff --git a/.github/workflows/guarantee-version-correctness.yml b/.github/workflows/version-check.yml similarity index 95% rename from .github/workflows/guarantee-version-correctness.yml rename to .github/workflows/version-check.yml index 51350800a..b496c0381 100644 --- a/.github/workflows/guarantee-version-correctness.yml +++ b/.github/workflows/version-check.yml @@ -8,7 +8,7 @@ on: - '*' pull_request: branches: [ main, dev, dajusto/validate-release-notes-are-provided ] - types: [labeled, unlabeled, synchronize] + types: [labeled, unlabeled, synchronize] # Trigger on PR labeling events, or a PR push (synchronize) paths: - '.github/workflows/guarantee-release-notes.yml' - '.github/workflows/guarantee-version-correctness.yml' @@ -16,6 +16,7 @@ on: jobs: build: runs-on: ubuntu-latest + # Skip all validation if label 'version-already-correct' is applied to the PR if: ${{ !contains(github.event.pull_request.labels.*.name, 'version-already-correct') }} steps: - uses: actions/checkout@v2 From d75a665639bdf297f7810beef3d96b3035d3a8d5 Mon Sep 17 00:00:00 2001 From: David Justo Date: Wed, 10 Apr 2024 22:48:09 -0700 Subject: [PATCH 38/38] change triggers --- .github/workflows/release-notes-check.yml | 3 ++- .github/workflows/version-check.yml | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release-notes-check.yml b/.github/workflows/release-notes-check.yml index 233ccb009..afc8c33ed 100644 --- a/.github/workflows/release-notes-check.yml +++ b/.github/workflows/release-notes-check.yml @@ -11,7 +11,8 @@ on: branches: [ main, dev, dajusto/validate-release-notes-are-provided ] types: [labeled, unlabeled, synchronize] # Trigger on PR labeling events, or a PR push (synchronize) paths: - - '.github/workflows/guarantee-release-notes.yml' + - '.github/workflows/release-notes-check.yml' + - '.github/workflows/version-check.yml' jobs: build: diff --git a/.github/workflows/version-check.yml b/.github/workflows/version-check.yml index b496c0381..46f1528dc 100644 --- a/.github/workflows/version-check.yml +++ b/.github/workflows/version-check.yml @@ -10,8 +10,8 @@ on: branches: [ main, dev, dajusto/validate-release-notes-are-provided ] types: [labeled, unlabeled, synchronize] # Trigger on PR labeling events, or a PR push (synchronize) paths: - - '.github/workflows/guarantee-release-notes.yml' - - '.github/workflows/guarantee-version-correctness.yml' + - '.github/workflows/release-notes-check.yml' + - '.github/workflows/version-check.yml' jobs: build: