From 0f91b229fa05d5fc60714e9a41fa85693a81fb3b Mon Sep 17 00:00:00 2001 From: David Holdeman Date: Tue, 21 Feb 2023 12:35:13 -0600 Subject: [PATCH] use read to store message in variable (#5116) --- .github/workflows/build-firmware.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-firmware.yaml b/.github/workflows/build-firmware.yaml index fd42015089..43824c1860 100644 --- a/.github/workflows/build-firmware.yaml +++ b/.github/workflows/build-firmware.yaml @@ -303,8 +303,11 @@ jobs: if: ${{ matrix.skip-rate && github.event_name != 'workflow_dispatch' || contains(github.event.head_commit.message, 'only:') }} run: | # if the commit message contains `only:`, get the part after the semicolon and check if it matches the build target. - if echo ${{ github.event.head_commit.message }} | grep "only:"; then - if [ "$(echo ${{ github.event.head_commit.message }} | grep -Po '(?<=only:)[^\s]*')" = "${{ matrix.build-target }}" ]; then + read -d ' ' MSG << EOM || true + ${{ github.event.head_commit.message }} + EOM + if echo $MSG | grep "only:"; then + if [ "$(echo $MSG | grep -Po '(?<=only:)[^\s]*')" = "${{ matrix.build-target }}" ]; then exit 0 else # if it doesn't match, skip this job.