From b1031060367b4c4ca545740ea1b1e97390f38ec8 Mon Sep 17 00:00:00 2001 From: sinu <65924192+sinui0@users.noreply.github.com> Date: Mon, 24 Jun 2024 20:57:35 -0700 Subject: [PATCH 1/2] chore: add rebase action --- .github/workflows/rebase.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/rebase.yml diff --git a/.github/workflows/rebase.yml b/.github/workflows/rebase.yml new file mode 100644 index 0000000000..26827dbd0e --- /dev/null +++ b/.github/workflows/rebase.yml @@ -0,0 +1,24 @@ +name: Automatic Rebase +on: + issue_comment: + types: [created] +jobs: + rebase: + name: Rebase + runs-on: ubuntu-latest + if: >- + github.event.issue.pull_request != '' && + contains(github.event.comment.body, '/rebase') && + github.event.comment.author_association == 'MEMBER' + steps: + - name: Checkout the latest code + uses: actions/checkout@v3 + with: + token: ${{ secrets.GITHUB_TOKEN }} + fetch-depth: 0 # otherwise, you will fail to push refs to dest repo + - name: Automatic Rebase + uses: cirrus-actions/rebase@1.8 + with: + autosquash: false + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 70f51e8305fd5684c456e79c12b79494a8ac9992 Mon Sep 17 00:00:00 2001 From: "sinu.eth" <65924192+sinui0@users.noreply.github.com> Date: Tue, 25 Jun 2024 10:47:35 -0700 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: Hendrik Eeckhaut --- .github/workflows/rebase.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rebase.yml b/.github/workflows/rebase.yml index 26827dbd0e..d28b07aac8 100644 --- a/.github/workflows/rebase.yml +++ b/.github/workflows/rebase.yml @@ -7,12 +7,12 @@ jobs: name: Rebase runs-on: ubuntu-latest if: >- - github.event.issue.pull_request != '' && + github.event.issue.pull_request != '' && contains(github.event.comment.body, '/rebase') && github.event.comment.author_association == 'MEMBER' steps: - name: Checkout the latest code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: token: ${{ secrets.GITHUB_TOKEN }} fetch-depth: 0 # otherwise, you will fail to push refs to dest repo