[testing workflows] Fix for multi-line commit message not triggering tests (#47353)

This commit is contained in:
Adrian Moldovan 2024-05-10 16:12:36 +03:00 committed by GitHub
parent a9e7acf04f
commit 981fca33d6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 10 additions and 10 deletions

View File

@ -120,14 +120,14 @@ jobs:
id: get_commit_message
run: |
if [[ "${{ github.event_name }}" == "push" ]]; then
echo "Commit message is ${{ github.event.head_commit.message }}"
echo "COMMIT_MESSAGE=${{ github.event.head_commit.message }}" >> "$GITHUB_OUTPUT"
COMMIT_MESSAGE=`echo "${{ github.event.head_commit.message }}" | head -1`
elif [[ "${{ github.event_name }}" == "pull_request" ]]; then
echo "Commit message is ${{ github.event.pull_request.title }}"
echo "COMMIT_MESSAGE=${{ github.event.pull_request.title }}" >> "$GITHUB_OUTPUT"
COMMIT_MESSAGE="${{ github.event.pull_request.title }}"
else
echo "Workflow triggered by other event"
COMMIT_MESSAGE="${{ github.event_name }}"
fi
echo "COMMIT_MESSAGE=$COMMIT_MESSAGE" >> "$GITHUB_OUTPUT"
shell: bash
- name: 'Prepare Test Environment'
@ -174,14 +174,14 @@ jobs:
id: get_commit_message
run: |
if [[ "${{ github.event_name }}" == "push" ]]; then
echo "Commit message is ${{ github.event.head_commit.message }}"
echo "COMMIT_MESSAGE=${{ github.event.head_commit.message }}" >> "$GITHUB_OUTPUT"
COMMIT_MESSAGE=`echo "${{ github.event.head_commit.message }}" | head -1`
elif [[ "${{ github.event_name }}" == "pull_request" ]]; then
echo "Commit message is ${{ github.event.pull_request.title }}"
echo "COMMIT_MESSAGE=${{ github.event.pull_request.title }}" >> "$GITHUB_OUTPUT"
COMMIT_MESSAGE="${{ github.event.pull_request.title }}"
else
echo "Workflow triggered by other event"
COMMIT_MESSAGE="${{ github.event_name }}"
fi
echo "COMMIT_MESSAGE=$COMMIT_MESSAGE" >> "$GITHUB_OUTPUT"
shell: bash
- name: 'Prepare Test Environment'