From 5318ce1f82579e88c3834a67d491040dbd160033 Mon Sep 17 00:00:00 2001 From: ihavecoke Date: Thu, 2 Nov 2023 14:08:47 +0800 Subject: [PATCH] Add auto create pull request action script --- .github/workflows/sync-feishu-pages.yml | 46 +++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/sync-feishu-pages.yml diff --git a/.github/workflows/sync-feishu-pages.yml b/.github/workflows/sync-feishu-pages.yml new file mode 100644 index 00000000..4f9588db --- /dev/null +++ b/.github/workflows/sync-feishu-pages.yml @@ -0,0 +1,46 @@ +name: Auto download feishu pages and create pull request +on: + push: + branches: + - feishu/* +jobs: + sync_feishu_pages: + name: download feishu pages + timeout-minutes: 30 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 1 + - name: Start export feishu pages + env: + FEISHU_APP_ID: ${{ secrets.FEISHU_APP_ID }} + FEISHU_APP_SECRET: ${{ secrets.FEISHU_APP_SECRET }} + FEISHU_SPACE_ID: '7288219896826494980' + OUTPUT_DIR: ./feishu-pages + uses: longbridgeapp/feishu-pages@main + - uses: oven-sh/setup-bun@v1 + - name: Copy feishu pages to repo + run: | + bun install + ./scripts/cp_feishu_to_vitepress.sh + bun autocorrect --fix locales/ + bun translate + - name: Commit all changed files + run: | + git config --global user.name "LongPort Github CI" + git config --global user.email "longportapp-github-ci@users.noreply.github.com" + git add . + git commit -a -m "Commit feishu pages to repo" + - name: Create Pull Request + uses: peter-evans/create-pull-request@v5 + with: + commit-message: New feishu pages version request review + base: canary + delete-branch: true + title: '[Docs] New feishu pages version request review' + body: | + New feishu pages version request review + assignees: ihavecoke + +