From 9603fa099b1452dc38d5c23662dfd9ab24caaa74 Mon Sep 17 00:00:00 2001 From: praydog Date: Tue, 12 Mar 2024 10:09:21 -0700 Subject: [PATCH] CI: Update for detached HEAD state --- .github/workflows/dev-build-pr.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/dev-build-pr.yml b/.github/workflows/dev-build-pr.yml index 0636326b..8a9f53c0 100644 --- a/.github/workflows/dev-build-pr.yml +++ b/.github/workflows/dev-build-pr.yml @@ -35,7 +35,8 @@ jobs: if : ${{ github.event_name == 'pull_request_target' }} shell: pwsh run: | - $previous_commit = git rev-parse 'HEAD^' + $commits = git log -n 2 --pretty=format:%H + $previous_commit = $commits[1] if ($previous_commit -ne "${{ github.event.pull_request.head.sha }}") { throw "The pull request head commit has changed since the event was triggered." }