Skip to content

Commit

Permalink
Read latest commit message as string, not array
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ItEndsWithTens committed Feb 21, 2024
1 parent bbee9a5 commit 7de383e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7de383e

Please sign in to comment.