use read to store message in variable (#5116)
This commit is contained in:
parent
e031b4cf16
commit
0f91b229fa
|
@ -303,8 +303,11 @@ jobs:
|
||||||
if: ${{ matrix.skip-rate && github.event_name != 'workflow_dispatch' || contains(github.event.head_commit.message, 'only:') }}
|
if: ${{ matrix.skip-rate && github.event_name != 'workflow_dispatch' || contains(github.event.head_commit.message, 'only:') }}
|
||||||
run: |
|
run: |
|
||||||
# if the commit message contains `only:`, get the part after the semicolon and check if it matches the build target.
|
# 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
|
read -d ' ' MSG << EOM || true
|
||||||
if [ "$(echo ${{ github.event.head_commit.message }} | grep -Po '(?<=only:)[^\s]*')" = "${{ matrix.build-target }}" ]; then
|
${{ 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
|
exit 0
|
||||||
else
|
else
|
||||||
# if it doesn't match, skip this job.
|
# if it doesn't match, skip this job.
|
||||||
|
|
Loading…
Reference in New Issue