Skip to content
This repository has been archived by the owner on Apr 9, 2024. It is now read-only.

Commit

Permalink
ci: migrate to new autorebase strategy (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
Xavientois authored Oct 15, 2021
1 parent b6f15da commit 64ea964
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 31 deletions.
12 changes: 1 addition & 11 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
version: 2.1

# Reusable YAML chunks
defaults:
autorebase_filters: &autorebase_filters
branches:
ignore:
- /rebase-pull-request-.*/
- /cherry-pick-rebase-pull-request-.*/

orbs:
vfcommon: voiceflow/common@0.0.187

Expand All @@ -27,9 +19,7 @@ workflows:
jobs:
- build-and-test:
context: dev-test
filters:
<<: *autorebase_filters


- vfcommon/release:
context: dev-test
requires:
Expand Down
20 changes: 0 additions & 20 deletions .github/workflows/autorebase.yaml

This file was deleted.

32 changes: 32 additions & 0 deletions .github/workflows/rebase.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Keeps the current branch up-to-date by rebasing to master when necessary
name: Automatic Rebase
on:
pull_request:
types: [opened, reopened, synchronize]

jobs:
rebase-to-master:
name: Rebase to Master
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: Find Pull Request
id: find-pr
uses: kylorhall/find-github-pull-request@v1.0.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
commitSha: ${{ github.sha }}
allowClosed: false
failIfNotFound: false

- name: Rebase Pull Request
if: ${{ steps.find-pr.outputs.number != '' }}
uses: voiceflow/rebase-many@v1.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBERS: ${{ steps.find-pr.outputs.number }}
17 changes: 17 additions & 0 deletions .github/workflows/rebase_all.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Keeps all incoming branches up-to-date by rebasing to master when necessary
name: Automatic Rebase All Branches
on:
push:
branches: [ master ]

jobs:
# When master updates, rebase all open pull requests
rebase-all-to-master:
name: Rebase All to Master
runs-on: ubuntu-latest
steps:
- name: Rebase All Incoming PRs
uses: voiceflow/rebase-incoming@v1.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
comment-on-failure: 'true'

0 comments on commit 64ea964

Please sign in to comment.