File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -29,12 +29,17 @@ jobs:
2929
3030 - name : Get commit messages
3131 id : get-commit-messages
32+ if : github.event_name == 'pull_request'
3233 run : |
3334 # Only look at the last 10 commits, to avoid getting too much data.
3435 # If the message wasn't in there (e.g. because the push was a merge and too large), then we just ignore it.
3536 git fetch --deepen=10
36- git log --format="%B" -10 ${{ github.event.before }}..${{ github.event.after }} > /tmp/commit_messages.txt || true
37- echo "COMMIT_MESSAGES=$(cat /tmp/commit_messages.txt)" >> $GITHUB_OUTPUT
37+ # Handle multiline output:
38+ {
39+ echo 'COMMIT_MESSAGES<<COMMIT_MESSAGES_EOF'
40+ git log --format="%B" -10 ${{ github.event.before }}..${{ github.event.after }} | tee /tmp/commit_messages.txt
41+ echo COMMIT_MESSAGES_EOF
42+ } >> $GITHUB_OUTPUT
3843
3944 - name : Set NO_CACHE variable based on commit messages and for nightly builds
4045 if : github.event_name == 'schedule' || contains(steps.get-commit-messages.outputs.COMMIT_MESSAGES, 'NO_CACHE=true')
4651 set -x
4752 printenv
4853 echo "NO_CACHE: ${NO_CACHE:-}"
54+ echo "EVENT_NAME: ${{ github.event_name }}"
55+ echo "BEFORE: ${{ github.event.before }}"
56+ echo "AFTER: ${{ github.event.after }}"
4957 echo "COMMIT_MESSAGES: ${{ steps.get-commit-messages.outputs.COMMIT_MESSAGES }}"
5058 echo "COMMIT_SHA: ${{ github.sha }}"
5159 echo "git log -1 ${{ github.sha }}: $(git log -1 ${{ github.sha }})"
You can’t perform that action at this time.
0 commit comments