From 808556a6a65c92ffe57c74a6d1ddcc31f72b88e3 Mon Sep 17 00:00:00 2001 From: Aireil <33433913+Aireil@users.noreply.github.com> Date: Fri, 15 Nov 2024 01:04:12 +0100 Subject: [PATCH] chore: fix broken action --- .github/workflows/build.yml | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5b08b5b..8e9b358 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,14 +29,17 @@ jobs: - name: Extract Branch id: extract_branch run: | - $branch_name = 'main' - $commit_messages = (echo "${{ toJSON(github.event.commits.*.message) }}") - - if ($commit_messages -match 'build\(([^)]+)\):') { - $branch_name = $matches[1] - } - - echo "branch_name=$branch_name" >> $GITHUB_OUTPUT + $branch_name = 'main' + $commit_messages = ${{ github.event.commits }} + + foreach ($commit in $commit_messages) { + if ($commit.message -match 'build\(([^)]+)\):') { + $branch_name = $matches[1] + break + } + } + + echo "branch_name=$branch_name" >> $GITHUB_OUTPUT - name: Setup MSBuild uses: microsoft/setup-msbuild@v1.0.2