Merge #6355: fix: fetch PR head before merging it in Check Merge Fast-Forward Only action

c3aae9e165 fix: fetch PR head before merging it in "check ff" (UdjinM6)

Pull request description:

  ## Issue being fixed or feature implemented
  ```
  v Run git fetch origin master:master
    git fetch origin master:master
    git checkout master
    if [[ "pull_request_target" == "pull_request"* ]]; then
      git merge --ff-only b216a402cc58cb153bebe137064fd0c804752d21
    else
      git merge --ff-only 3a18f087bf
    fi
    shell: /usr/bin/bash -e {0}
  From https://github.com/dashpay/dash
   * [new branch]          master     -> master
  Switched to branch 'master'
  merge: b216a402cc58cb153bebe137064fd0c804752d21 - not something we can merge
  Error: Process completed with exit code 1.
  ```
  https://github.com/dashpay/dash/actions/runs/11492009432/job/31999602262?pr=6346

  So it's picking the right commit sha now but it has no commit itself.

  #6344 follow-up

  ## What was done?

  ## How Has This Been Tested?

  ## Breaking Changes

  ## Checklist:
  - [ ] I have performed a self-review of my own code
  - [ ] I have commented my code, particularly in hard-to-understand areas
  - [ ] I have added or updated relevant unit/integration/functional/e2e tests
  - [ ] I have made corresponding changes to the documentation
  - [ ] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_

ACKs for top commit:
  PastaPastaPasta:
    utACK c3aae9e165

Tree-SHA512: 6a50d3ad40ac54aa919e970b9509e78aa61dbdfc9211e8837b5bf470ee8f0b1b68f53d082d04e8e6f375bd0bb62d92951f69cde5985b6fd1482a0cd531abf8ba
This commit is contained in:
pasta 2024-10-24 10:35:37 -05:00
commit dda9b73ac8
No known key found for this signature in database
GPG Key ID: E2F3D7916E722D38

View File

@ -28,6 +28,7 @@ jobs:
git fetch origin master:master git fetch origin master:master
git checkout master git checkout master
if [[ "${{ github.event_name }}" == "pull_request"* ]]; then if [[ "${{ github.event_name }}" == "pull_request"* ]]; then
git fetch origin pull/${{ github.event.pull_request.number }}/head
git merge --ff-only ${{ github.event.pull_request.head.sha }} git merge --ff-only ${{ github.event.pull_request.head.sha }}
else else
git merge --ff-only ${{ github.sha }} git merge --ff-only ${{ github.sha }}