Skip to content

Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.

ci: save pr id during pr title check (#503)

白熱8afc5320d6b1
diff --git a/.github/workflows/ci-preview.yml b/.github/workflows/ci-preview.yml
index d6c37eda72..c8acc7500d 100644
--- a/.github/workflows/ci-preview.yml
+++ b/.github/workflows/ci-preview.yml
@@ -2,7 +2,7 @@ name: 📦 CI Preview
on:
workflow_run:
- workflows: ["📌 PR Title Lint"]
+ workflows: ['📌 PR Title Lint']
types:
- completed
@@ -56,7 +56,14 @@ jobs:
- name: 📦 Build demo
run: pnpm run build:demo
- - name: Save PR id
+ - name: download pr artifact
+ uses: dawidd6/action-download-artifact@v2
+ with:
+ workflow: ${{ github.event.workflow_run.workflow_id }}
+ run_id: ${{ github.event.workflow_run.id }}
+ name: pr
+
+ - name: save PR id
id: pr
run: echo "id=$(<pr-id.txt)" >> $GITHUB_OUTPUT
diff --git a/.github/workflows/pr-title-lint.yml b/.github/workflows/pr-title-lint.yml
index 7c404bade7..f779b8d803 100644
--- a/.github/workflows/pr-title-lint.yml
+++ b/.github/workflows/pr-title-lint.yml
@@ -1,52 +1,63 @@
name: 📌 PR Title Lint
on:
- pull_request:
- types:
- - opened
- - edited
- - synchronize
+ pull_request:
+ types:
+ - opened
+ - edited
+ - synchronize
permissions:
- contents: read
+ contents: read
jobs:
- check-pull-request-title:
- name: Check pull request title
- runs-on: ubuntu-latest
- steps:
- - name: Checkout
- uses: actions/checkout@v3
-
- - name: Install Node.js
- uses: actions/setup-node@v3
- with:
- node-version: 16
-
- - name: Install pnpm
- uses: pnpm/action-setup@v2
- with:
- version: 8
- run_install: false
-
- - name: Get pnpm store directory
- shell: bash
- run: |
- echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
-
- - name: Setup pnpm cache
- uses: actions/cache@v3
- with:
- path: ${{ env.STORE_PATH }}
- key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
- restore-keys: |
- ${{ runner.os }}-pnpm-store-
-
- - name: Install dependencies
- run: pnpm install
-
- - run: echo "${{ github.event.pull_request.title }}" | pnpx commitlint -g ./commitlint.config.cjs
-
- - name: Save PR number
- if: ${{ always() }}
- run: echo ${{ github.event.number }} > ./pr-id.txt
+ check-pull-request-title:
+ name: Check pull request title
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v3
+
+ - name: Install Node.js
+ uses: actions/setup-node@v3
+ with:
+ node-version: 16
+
+ - name: Install pnpm
+ uses: pnpm/action-setup@v2
+ with:
+ version: 8
+ run_install: false
+
+ - name: Get pnpm store directory
+ shell: bash
+ run: |
+ echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
+
+ - name: Setup pnpm cache
+ uses: actions/cache@v3
+ with:
+ path: ${{ env.STORE_PATH }}
+ key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
+ restore-keys: |
+ ${{ runner.os }}-pnpm-store-
+
+ - name: Install dependencies
+ run: pnpm install
+
+ - run: echo "${{ github.event.pull_request.title }}" | pnpx commitlint -g ./commitlint.config.cjs
+
+ set-pr-id:
+ name: Set PR ID
+ runs-on: ubuntu-latest
+ steps:
+ - name: Save PR number
+ if: ${{ always() }}
+ run: echo ${{ github.event.pull_request.number }} > ./pr-id.txt
+
+ - name: Upload PR number
+ if: ${{ always() }}
+ uses: actions/upload-artifact@v3
+ with:
+ name: pr
+ path: ./pr-id.txt