From 8f436646cd91120a2fdb4d566ac5093e1f0b67d6 Mon Sep 17 00:00:00 2001 From: dw-0 Date: Sun, 9 Mar 2025 12:44:59 +0100 Subject: [PATCH] cicd: add action for fast-forward check and merge (#660) Signed-off-by: Dominik Willner --- .github/workflows/fast-forward.yml | 26 ++++++++++++++++++++++++++ .github/workflows/pull-request.yml | 25 +++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 .github/workflows/fast-forward.yml create mode 100644 .github/workflows/pull-request.yml diff --git a/.github/workflows/fast-forward.yml b/.github/workflows/fast-forward.yml new file mode 100644 index 0000000..de4e10c --- /dev/null +++ b/.github/workflows/fast-forward.yml @@ -0,0 +1,26 @@ +name: fast-forward +on: + issue_comment: + types: [created, edited] +jobs: + fast-forward: + # Only run if the comment contains the /fast-forward command. + if: ${{ contains(github.event.comment.body, '/fast-forward') + && github.event.issue.pull_request }} + runs-on: ubuntu-latest + + permissions: + contents: write + pull-requests: write + issues: write + + steps: + - name: Fast forwarding + uses: sequoia-pgp/fast-forward@v1 + with: + merge: true + # To reduce the workflow's verbosity, use 'on-error' + # to only post a comment when an error occurs, or 'never' to + # never post a comment. (In all cases the information is + # still available in the step's summary.) + comment: on-error diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml new file mode 100644 index 0000000..33eccb4 --- /dev/null +++ b/.github/workflows/pull-request.yml @@ -0,0 +1,25 @@ +name: pull-request +on: + pull_request: + types: [opened, reopened, synchronize] +jobs: + check-fast-forward: + runs-on: ubuntu-latest + + permissions: + contents: read + # We appear to need write permission for both pull-requests and + # issues in order to post a comment to a pull request. + pull-requests: write + issues: write + + steps: + - name: Checking if fast forwarding is possible + uses: sequoia-pgp/fast-forward@v1 + with: + merge: false + # To reduce the workflow's verbosity, use 'on-error' + # to only post a comment when an error occurs, or 'never' to + # never post a comment. (In all cases the information is + # still available in the step's summary.) + comment: on-error