Skip to content

Commit

Permalink
feat(ci): Add sync workflow (#288)
Browse files Browse the repository at this point in the history
  • Loading branch information
madonuko authored Mar 19, 2023
1 parent d47c0da commit fb81413
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Sync PR to other branches
on:
pull_request:
types:
- closed
branches:
- main

jobs:
sync:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: Setup Git
run: |
mkdir -p ${{ runner.temp }}
echo "${{ secrets.SSH_SIGNING_KEY }}" > ${{ runner.temp }}/signing_key
chmod 0700 ${{ runner.temp }}/signing_key
git config --global --add safe.directory "$GITHUB_WORKSPACE"
git config user.name "Raboneko"
git config user.email "[email protected]"
git config gpg.format "ssh"
git config user.signingkey "${{ runner.temp }}/signing_key"
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ssh-key: ${{ secrets.SSH_AUTHENTICATION_KEY }}
- name: Download patches
run: |
curl https://github.com/terrapkg/packages/pull/${{ github.event.pull_request.number }}.patch > pr.patch
- name: Apply patches
run: |
git checkout f38
git am --keep-cr --signoff < pr.patch
- name: Push
run: git push origin -u --all

0 comments on commit fb81413

Please sign in to comment.