From 14d4c5f36f619dbfba24c887747fae7e05c51554 Mon Sep 17 00:00:00 2001 From: shanshanzhong Date: Mon, 25 May 2026 22:08:48 -0700 Subject: [PATCH] =?UTF-8?q?=E9=85=8D=E7=BD=AE(#54):=20=E5=89=8D=E7=AB=AF?= =?UTF-8?q?=20PR=20=E8=B4=A8=E9=87=8F=E9=97=A8=E7=A6=81=E4=B8=8E=20auto-me?= =?UTF-8?q?rge=20=E5=AE=89=E5=85=A8=E5=8A=A0=E5=9B=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/auto-merge.yml | 41 +++++++++++++-------------- .github/workflows/pr-check.yml | 48 ++++++++++++++++++++++++++++++++ .github/workflows/release.yml | 13 ++++++--- 3 files changed, 77 insertions(+), 25 deletions(-) create mode 100644 .github/workflows/pr-check.yml diff --git a/.github/workflows/auto-merge.yml b/.github/workflows/auto-merge.yml index eea0d46..2f113aa 100644 --- a/.github/workflows/auto-merge.yml +++ b/.github/workflows/auto-merge.yml @@ -1,30 +1,29 @@ name: Dependabot Auto Merge + on: pull_request_target: - types: [labeled, edited] + types: [opened, reopened, synchronize, ready_for_review, labeled] + +permissions: + contents: write + pull-requests: write + +concurrency: + group: dependabot-auto-merge-${{ github.event.pull_request.number }} + cancel-in-progress: true jobs: merge: - if: contains(github.event.pull_request.labels.*.name, 'dependencies') + if: > + github.actor == 'dependabot[bot]' && + github.event.pull_request.user.login == 'dependabot[bot]' && + contains(github.event.pull_request.labels.*.name, 'dependencies') name: Dependabot Auto Merge runs-on: ubuntu-latest + timeout-minutes: 5 steps: - - uses: actions/checkout@v4 - - - name: Install pnpm - uses: pnpm/action-setup@v4 - - - name: Setup Node.js environment - uses: actions/setup-node@v4 - with: - node-version: '20' - - - name: Install deps - run: pnpm install - - - name: Merge - uses: ahmadnassri/action-dependabot-auto-merge@v2 - with: - command: merge - target: minor - github-token: ${{ secrets.GH_TOKEN }} + - name: Enable auto-merge + env: + GH_TOKEN: ${{ github.token }} + PR_URL: ${{ github.event.pull_request.html_url }} + run: gh pr merge "$PR_URL" --auto --merge diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml new file mode 100644 index 0000000..d266a14 --- /dev/null +++ b/.github/workflows/pr-check.yml @@ -0,0 +1,48 @@ +name: PR Check + +on: + push: + branches: + - main + - internal + pull_request: + branches: + - main + - internal + +permissions: + contents: read + +concurrency: + group: pr-check-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + validate: + name: Lint, Check, Test and Build + runs-on: ubuntu-latest + timeout-minutes: 20 + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Bun + uses: oven-sh/setup-bun@v2 + with: + bun-version: '1.3.1' + + - name: Install dependencies + run: bun install --frozen-lockfile + + - name: Lint + run: bun run lint + + - name: Check + run: bun run check + + - name: Test + run: bun run test + + - name: Build + run: bun run build diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ea9fa78..b56d997 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,20 +9,25 @@ on: permissions: contents: write +concurrency: + group: release-${{ github.ref }} + cancel-in-progress: false + jobs: release: name: Build runs-on: ubuntu-latest + timeout-minutes: 30 steps: - uses: actions/checkout@v4 - name: Setup Bun - uses: oven-sh/setup-bun@v1 + uses: oven-sh/setup-bun@v2 with: - bun-version: 'latest' + bun-version: '1.3.1' - name: Cache Bun dependencies - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: | ~/.bun @@ -32,7 +37,7 @@ jobs: ${{ runner.os }}-bun-cache- - name: Install deps - run: bun install + run: bun install --frozen-lockfile - name: Build run: bun run build