From fb81413ee1c3bd09e393174e74215c327a4d0dda Mon Sep 17 00:00:00 2001 From: madomado Date: Mon, 20 Mar 2023 04:49:35 +0800 Subject: [PATCH] feat(ci): Add sync workflow (#288) --- .github/workflows/sync.yml | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/sync.yml diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml new file mode 100644 index 0000000000..3c59a8caa6 --- /dev/null +++ b/.github/workflows/sync.yml @@ -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 "raboneko@fyralabs.com" + 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