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