diff --git a/.github/workflows/auto-merge.yml b/.github/workflows/auto-merge.yml index 6a65d3b20c..179ad81397 100644 --- a/.github/workflows/auto-merge.yml +++ b/.github/workflows/auto-merge.yml @@ -4,7 +4,7 @@ name: Auto Merge Main into Feature Branch on: pull_request: - types: [ opened, synchronize, reopened, labeled ] + types: [opened, synchronize, reopened, labeled] jobs: auto-merge: @@ -34,13 +34,17 @@ jobs: git config --global user.email '${{ steps.import_gpg.outputs.email }}' - name: Fetch all branches - run: git fetch --all + run: git fetch origin - name: Checkout the feature branch run: git checkout ${{ github.event.pull_request.head.ref }} - name: Merge main into feature branch - run: git merge origin/main + run: git merge --squash origin/main + + - name: Commit changes + run: git commit -S -s -m "Merge main into ${{ github.event.pull_request.head.ref }}" + if: success() - name: Push changes run: git push origin ${{ github.event.pull_request.head.ref }} @@ -72,4 +76,4 @@ jobs: repo: context.repo.repo, issue_number: prNumber, body: 'The main branch cannot be merged into the feature branch without your help :cry:' - }); + }); diff --git a/.github/workflows/ff-merge.yml b/.github/workflows/ff-merge.yml deleted file mode 100644 index 38c9ac1c97..0000000000 --- a/.github/workflows/ff-merge.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Fast-forward merge - -# This workflow helps to work around the bug in the **Rebase and Merge** pull requests strategy. -# The bug leads to unsigned commits and prevents using the strategy -# without IOG policy violation (all commits must be signed by PGP signature). -# -# This workflow helps to merge multiple commits from PR to main branch of the repository -# without loosing of PGP signature. -# -# Related GitHub discussions: -# https://github.com/community/community/discussions/10410 -# https://github.com/orgs/community/discussions/5524 - -on: - issue_comment: - types: [created] - -jobs: - fast_forward_job: - name: Fast Forward Merge - runs-on: self-hosted - if: | - github.event.issue.pull_request != '' && - contains(github.event.comment.body, '/fast-forward') - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Fast Forward Merge - uses: endre-spotlab/fast-forward-js-action@2.1 - with: - GITHUB_TOKEN: ${{ secrets.ATALA_GITHUB_TOKEN }} - success_message: "Success! Fast forwarded ***target_base*** to ***source_head***! ```git checkout target_base && git merge source_head --ff-only``` " - failure_message: "Failed! Cannot do fast forward!"