From 8e6cdf88cc9fc9347f443e44eb670e0677fedcc5 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sun, 18 Feb 2024 00:09:50 +0100 Subject: [PATCH 1/2] Comment for prerelease --- scripts/main.ps1 | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/scripts/main.ps1 b/scripts/main.ps1 index 430a68b..f92b8b0 100644 --- a/scripts/main.ps1 +++ b/scripts/main.ps1 @@ -229,6 +229,16 @@ if ($createPrerelease -or $createRelease -or $whatIf) { exit $LASTEXITCODE } } + + if ($whatIf) { + Write-Output 'WhatIf: gh pr comment $pull_request.number -b "The release [$newVersion] has been created."' + } else { + gh pr comment $pull_request.number -b "The release [$newVersion] has been created." + if ($LASTEXITCODE -ne 0) { + Write-Error "Failed to comment on the pull request." + exit $LASTEXITCODE + } + } } else { if ($whatIf) { Write-Output "WhatIf: gh release create $newVersion --title $newVersion --generate-notes" From 74b2b31cc1562c2557b0791fb72b611371e0b7a6 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sun, 18 Feb 2024 00:54:40 +0100 Subject: [PATCH 2/2] Allow WFs to wrtite to PRs --- .github/workflows/Auto-Release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/Auto-Release.yml b/.github/workflows/Auto-Release.yml index ef5715b..e59d647 100644 --- a/.github/workflows/Auto-Release.yml +++ b/.github/workflows/Auto-Release.yml @@ -18,6 +18,7 @@ concurrency: permissions: contents: write + pull-requests: write jobs: Auto-Release: