diff --git a/.github/actions/get-commit-msg/action.yml b/.github/actions/get-commit-msg/action.yml index 863662e0e9..6aa41c8ea5 100644 --- a/.github/actions/get-commit-msg/action.yml +++ b/.github/actions/get-commit-msg/action.yml @@ -17,15 +17,17 @@ runs: echo "Date: ${TSTAMP}" >> /tmp/commit_msg.txt echo "" >> /tmp/commit_msg.txt echo "${{ github.event.head_commit.message }}" >> /tmp/commit_msg.txt - - name: Checkout code + - name: Find commit message (PR) shell: bash id: checkout_code if: github.event_name == 'pull_request' run: | + echo "+++++ head commit message +++++" + echo "$(git log -1 --no-merges)" + echo "+++++++++++++++++++++++++++++++" echo "hash=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT" - git checkout ${{ github.event.pull_request.head.ref }} - COMMIT_MESSAGE=$(git log -1) - echo "$(git log -1)" >> /tmp/commit_msg.txt + git checkout ${{ github.event.pull_request.head.sha }} + echo "$(git log -1 --no-merges)" >> /tmp/commit_msg.txt - shell: bash id: action_output run: | @@ -36,8 +38,8 @@ runs: echo "----- got commit message ---" cat /tmp/commit_msg.txt echo "----------------------------" - - name: Uncheckout code + - name: Cleanup Find commit message (PR) shell: bash if: github.event_name == 'pull_request' run: | - git checkout ${{ steps.checkout_code.outputs.hash }} + git checkout ${{ steps.checkout_code.outputs.hash }} \ No newline at end of file diff --git a/.github/workflows/presubmit.yml b/.github/workflows/presubmit.yml index 4925f61760..1d7b394c25 100644 --- a/.github/workflows/presubmit.yml +++ b/.github/workflows/presubmit.yml @@ -122,9 +122,6 @@ jobs: fetch-depth: 0 - id: get_commit_msg uses: ./.github/actions/get-commit-msg - - uses: actions/checkout@v4.1.6 - with: - fetch-depth: 0 - uses: ./.github/actions/mac-prereq - name: Cache Mesa and deps uses: actions/cache@v4