summaryrefslogtreecommitdiffstats
path: root/.github
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@users.noreply.github.com>2022-04-14 08:59:09 +0200
committerGitHub <noreply@github.com>2022-04-14 08:59:09 +0200
commit4bb8d00ed5c44b632ff6dcf7710ffbf88927b07a (patch)
treedde236bd5139ab70c5e46b53e94552f853c84813 /.github
parent1bd3a501966b78f961140de0b3304985137f13de (diff)
Create command-rebase.yml
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/command-rebase.yml46
1 files changed, 46 insertions, 0 deletions
diff --git a/.github/workflows/command-rebase.yml b/.github/workflows/command-rebase.yml
new file mode 100644
index 00000000..4e41c31d
--- /dev/null
+++ b/.github/workflows/command-rebase.yml
@@ -0,0 +1,46 @@
+# This workflow is provided via the organization template repository
+#
+# https://github.com/nextcloud/.github
+# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
+
+name: Rebase command
+
+on:
+ issue_comment:
+ types: created
+
+jobs:
+ rebase:
+ runs-on: ubuntu-latest
+
+ # On pull requests and if the comment starts with `/rebase`
+ if: github.event.issue.pull_request != '' && startsWith(github.event.comment.body, '/rebase')
+
+ steps:
+ - name: Add reaction on start
+ uses: peter-evans/create-or-update-comment@v2
+ with:
+ token: ${{ secrets.COMMAND_BOT_PAT }}
+ repository: ${{ github.event.repository.full_name }}
+ comment-id: ${{ github.event.comment.id }}
+ reaction-type: "+1"
+
+ - name: Checkout the latest code
+ uses: actions/checkout@v3
+ with:
+ fetch-depth: 0
+ token: ${{ secrets.COMMAND_BOT_PAT }}
+
+ - name: Automatic Rebase
+ uses: cirrus-actions/rebase@1.5
+ env:
+ GITHUB_TOKEN: ${{ secrets.COMMAND_BOT_PAT }}
+
+ - name: Add reaction on failure
+ uses: peter-evans/create-or-update-comment@v2
+ if: failure()
+ with:
+ token: ${{ secrets.COMMAND_BOT_PAT }}
+ repository: ${{ github.event.repository.full_name }}
+ comment-id: ${{ github.event.comment.id }}
+ reaction-type: "-1"