Skip to content

Commit

Permalink
ci: Add rebase workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
akirak committed Nov 5, 2023
1 parent f991f70 commit 87d26ff
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/rebase-onto-upstream.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Rebase onto upstream

on:
workflow_dispatch:
schedule:
- cron: '0 8 * * 5'

jobs:
push:
runs-on: ubuntu-latest

strategy:
matrix:
base_ref:
- akirak
# - admin
upstream_branch:
- 'master'

steps:

- uses: actions/checkout@v3
with:
fetch-depth: 0
sparse-checkout: '.'
ref: ${{ matrix.base_ref }}

- name: Switch the branch
run: |
git switch -C tmp akirak
- name: Fetch the upstream
run: |
git remote add upstream https://github.com/melpa/melpa.git
git fetch upstream ${{ matrix.upstream_branch }}
- name: Cherry pick commits
run: |
git config --add user.name 'github-actions[bot]'
git config --add user.email '6270544+github-actions[bot]@users.noreply.github.com'
git rebase -s ort -X theirs upstream/${{ matrix.upstream_branch }}
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.PAT_PUSH }}
branch: '${{ matrix.base_ref }}-tmp'
force: true

0 comments on commit 87d26ff

Please sign in to comment.