From da961f480b3f09f9db3c39189c82d462ce2fa8e5 Mon Sep 17 00:00:00 2001 From: Nicola Corti Date: Tue, 9 Aug 2022 04:38:56 -0700 Subject: [PATCH] Setup Automatic Rebase given a /rebase comment (#34369) Summary: This is a nit, but at least will help us reduce requests to rebase for PRs which maybe have a broken CI due to a stale base commit. I've limited the scope to members and owners. A `/rebase` will trigger a rebase authored by Github Action bot. We can play a bit around with it, and remove it if it doesn't really work well for us. ## Changelog [Internal] - Setup Automatic Rebase given a /rebase comment Pull Request resolved: https://github.com/facebook/react-native/pull/34369 Test Plan: Nothing to test here. Reviewed By: cipolleschi Differential Revision: D38509480 Pulled By: cortinico fbshipit-source-id: 1df3927638b162d4a787c81372a835d583159498 --- .github/workflows/autorebase.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/autorebase.yml diff --git a/.github/workflows/autorebase.yml b/.github/workflows/autorebase.yml new file mode 100644 index 00000000000000..9cb17dd30d652a --- /dev/null +++ b/.github/workflows/autorebase.yml @@ -0,0 +1,19 @@ +name: Automatic Rebase +on: + issue_comment: + types: [created] +jobs: + rebase: + name: Rebase + if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/rebase') && (github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER') + runs-on: ubuntu-latest + steps: + - name: Checkout the latest code + uses: actions/checkout@v2 + 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.7 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}