From 87a148e09f2d23e49a2b6bf575c604e31a339ed8 Mon Sep 17 00:00:00 2001 From: LY <51789698+Young-Lord@users.noreply.github.com> Date: Mon, 1 Jan 2024 14:49:15 +0800 Subject: [PATCH] ci: add fast-forward merge support --- .github/workflows/fast-forward.yml | 32 ++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/fast-forward.yml diff --git a/.github/workflows/fast-forward.yml b/.github/workflows/fast-forward.yml new file mode 100644 index 0000000..bdf062a --- /dev/null +++ b/.github/workflows/fast-forward.yml @@ -0,0 +1,32 @@ +name: fast-forward for PR +# GitHub doesn't support fast-forward merge of PR, +# which causes GPG signatures overriden by GitHub's key. +# This workflow allows maintainers to do a fast-forward merge +# by replying `/fast-forward` to the PR. +# +# Contributors must first rebase onto the latest commit before PR to make fast-forward possible. +on: + issue_comment: + types: [created, edited] +jobs: + fast-forward: + if: ${{ contains(github.event.comment.body, '/fast-forward') + && github.event.issue.pull_request }} + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + + steps: + - name: Check User Permission + id: check-perm + uses: actions-cool/check-user-permission@v2.2.0 + with: + require: write + + - name: Fast forwarding + if: steps.check-perm.outputs.require-result + uses: sequoia-pgp/fast-forward@v1 + with: + merge: true + comment: on-error