From 7de383e595588f515cb641f6fa14d27757723b65 Mon Sep 17 00:00:00 2001 From: Rob Martens Date: Wed, 21 Feb 2024 04:41:45 -0500 Subject: [PATCH] Read latest commit message as string, not array This is what was wrong the whole time! A one-line commit message was treated as a string, but multiple lines became an array, which complicated both the StartsWith call and use of the -match command. Piping through the Out-String commandlet should do the trick. So [skip benchmarks] already, damn it. --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2b8a6f3..bc487a3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -87,14 +87,14 @@ jobs: # commits cause big jumps that throw off one's expectations. foreach ($sha in $(git rev-list HEAD)) { - $msg = $(git show -s --format=%B $sha) + $msg = $(git show -s --format=%B $sha) | Out-String # In case of a force push to a pull request, Github will add an # invisible merge commit that doesn't contain the expected newest # commit message. Merge commits should otherwise be rare in a PR, # so simply checking the message for the word "Merge" handles this. $pr = "${{ github.event_name == 'pull_request' }}" -eq 'true' - $merge = ($msg -split '\n')[0].StartsWith('Merge') + $merge = $msg.StartsWith('Merge') if ($pr -and $merge) { continue