From 82b9df94992d601c14e6b4ac0b2b60f48bf17089 Mon Sep 17 00:00:00 2001 From: Kevin YU Date: Mon, 19 Jun 2023 21:24:44 +0800 Subject: [PATCH] ci: add sync-upstream workflow --- .github/workflows/sync-upstream.yml | 42 +++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/sync-upstream.yml diff --git a/.github/workflows/sync-upstream.yml b/.github/workflows/sync-upstream.yml new file mode 100644 index 00000000..a5858d11 --- /dev/null +++ b/.github/workflows/sync-upstream.yml @@ -0,0 +1,42 @@ +name: Synchronize Upstream + +on: + workflow_dispatch: + inputs: + wing-head: + type: string + required: true + default: main + wing-sync-message: + type: string + required: true + default: 'chore(sync): upgrade dae-wing' + pr-branch: + type: string + required: true + default: sync-upstream + +jobs: + sync-wing: + runs-on: ubuntu-latest + if: ${{ inputs.wing-head }} + steps: + - uses: actions/checkout@v3 + with: + submodules: recursive + fetch-depth: 0 + ref: main + + - name: Sync dae-wing upstream + run: | + git checkout origin/${{ inputs.wing-head }} + working-directory: wing + + - name: Commit and push changes + run: | + git config user.name "daebot" + git config user.email "daebot@v2raya.org" + git checkout -b ${{ inputs.pr-branch }} + git add . + git commit -m "${{ inputs.wing-sync-message }}" --no-verify + git push -u origin ${{ inputs.pr-branch }}