From c4df52c9009d1f1856f8b75f0392aef6a4fdbcc9 Mon Sep 17 00:00:00 2001 From: Kyle Somers <17753062+kylesomers@users.noreply.github.com> Date: Sat, 28 Sep 2024 20:28:18 +0000 Subject: [PATCH 1/2] ci: add pr-rebase.yml workflow --- .github/workflows/pr-rebase.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/pr-rebase.yml diff --git a/.github/workflows/pr-rebase.yml b/.github/workflows/pr-rebase.yml new file mode 100644 index 00000000..75f25072 --- /dev/null +++ b/.github/workflows/pr-rebase.yml @@ -0,0 +1,19 @@ +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') || contains(github.event.comment.body, '/autosquash')) && github.event.comment.author_association == 'MEMBER' + steps: + - name: Checkout the latest code + uses: actions/checkout@v4 + with: + token: ${{ secrets.BOT_PAT }} + fetch-depth: 0 + - name: Automatic Rebase + uses: cirrus-actions/rebase@1.8 + env: + GITHUB_TOKEN: ${{ secrets.BOT_PAT }} \ No newline at end of file From 8820f562bc9cd223146104adb283bcbe1ea1acb7 Mon Sep 17 00:00:00 2001 From: Kyle Somers <17753062+kylesomers@users.noreply.github.com> Date: Mon, 30 Sep 2024 20:22:21 +0000 Subject: [PATCH 2/2] ci: modify permissions on workflow --- .github/workflows/pr-rebase.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/pr-rebase.yml b/.github/workflows/pr-rebase.yml index 75f25072..63ccb8cb 100644 --- a/.github/workflows/pr-rebase.yml +++ b/.github/workflows/pr-rebase.yml @@ -2,10 +2,15 @@ name: Automatic Rebase on: issue_comment: types: [created] +permissions: + contents: read jobs: rebase: name: Rebase runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write if: github.event.issue.pull_request != '' && (contains(github.event.comment.body, '/rebase') || contains(github.event.comment.body, '/autosquash')) && github.event.comment.author_association == 'MEMBER' steps: - name: Checkout the latest code