Skip to content

Commit

Permalink
multiline support in LAST_COMMIT_MESSAGE
Browse files Browse the repository at this point in the history
  • Loading branch information
andiradulescu committed Jul 20, 2024
1 parent 24bec4a commit 92e8a8d
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,18 @@ jobs:

- name: Get commit message
run: |
if [ "${{ github.event_name }}" == "push" ]; then
echo "LAST_COMMIT_MESSAGE='${{ github.event.head_commit.message }}'" | tee -a $GITHUB_ENV
elif [ "${{ github.event_name }}" == "workflow_run" ]; then
echo "LAST_COMMIT_MESSAGE='${{ github.event.workflow_run.head_commit.message }}'" | tee -a $GITHUB_ENV
elif [ "${{ github.event_name }}" == "pull_request" ]; then
echo "LAST_COMMIT_MESSAGE=$(curl -s '${{ github.event.pull_request.commits_url }}' | jq -r '.[-1].commit.message')" | tee -a $GITHUB_ENV
fi
{
echo 'LAST_COMMIT_MESSAGE<<EOF'
if [ "${{ github.event_name }}" == "push" ]; then
echo "${{ github.event.head_commit.message }}"
elif [ "${{ github.event_name }}" == "workflow_run" ]; then
echo "${{ github.event.workflow_run.head_commit.message }}"
elif [ "${{ github.event_name }}" == "pull_request" ]; then
echo "$(curl -s '${{ github.event.pull_request.commits_url }}' | jq -r '.[-1].commit.message')"
fi
echo EOF
} | tee -a $GITHUB_ENV
- name: Get kernel submodule ref
id: kernel-submodule
run: echo "ref=$(git ls-tree HEAD | awk '$4 == "agnos-kernel-sdm845"' | awk '{print $3}')" | tee -a $GITHUB_OUTPUT
Expand Down

0 comments on commit 92e8a8d

Please sign in to comment.