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: fix pull request from fork not triggering ci process correctly

白熱7ef994ed9e96
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 3bcb01771d..3c514ab996 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -20,7 +20,7 @@ jobs:
steps:
- name: Checkout
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
- name: Setup Node.js
uses: ./.github/actions/setup-node
@@ -28,15 +28,16 @@ jobs:
- name: 📦 Build
run: pnpm run build
- set-pr-id:
- name: set PR ID
+ set-pr-info:
+ name: set PR info
runs-on: ubuntu-latest
steps:
- - name: Save PR number
+ - name: Save PR info
if: ${{ always() }}
run: |
echo ${{ github.event.pull_request.number }} > ./pr-id.txt
echo ${{ github.head_ref }} >> ./pr-ref.txt
+ echo ${{ github.event.pull_request.head.repo.full_name || github.repository }} >> ./pr-repo.txt
- name: Upload PR number
if: ${{ always() }}
@@ -51,3 +52,10 @@ jobs:
with:
name: pr-ref
path: ./pr-ref.txt
+
+ - name: Upload PR repo
+ if: ${{ always() }}
+ uses: actions/upload-artifact@v3
+ with:
+ name: pr-repo
+ path: ./pr-repo.txt
diff --git a/.github/workflows/ci-lint.yml b/.github/workflows/ci-lint.yml
index b52b734a30..a3c0001aca 100644
--- a/.github/workflows/ci-lint.yml
+++ b/.github/workflows/ci-lint.yml
@@ -19,7 +19,7 @@ jobs:
steps:
- name: Checkout
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
- name: Setup Node.js
uses: ./.github/actions/setup-node
@@ -36,7 +36,7 @@ jobs:
steps:
- name: Checkout
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
- name: Setup Node.js
uses: ./.github/actions/setup-node
@@ -53,7 +53,7 @@ jobs:
steps:
- name: Checkout
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
- name: Setup Node.js
uses: ./.github/actions/setup-node
diff --git a/.github/workflows/ci-test.yml b/.github/workflows/ci-test.yml
index 0a85d3309b..94c1ac9379 100644
--- a/.github/workflows/ci-test.yml
+++ b/.github/workflows/ci-test.yml
@@ -16,7 +16,7 @@ jobs:
steps:
- name: Checkout
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
- name: Setup Node.js
uses: ./.github/actions/setup-node
diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml
index d022294094..3d7efc0d76 100644
--- a/.github/workflows/playwright.yml
+++ b/.github/workflows/playwright.yml
@@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- name: Setup Node.js
uses: ./.github/actions/setup-node
diff --git a/.github/workflows/preview-deploy.yml b/.github/workflows/preview-deploy.yml
index ec18d1bc61..b24b0439ec 100644
--- a/.github/workflows/preview-deploy.yml
+++ b/.github/workflows/preview-deploy.yml
@@ -15,11 +15,12 @@ jobs:
runs-on: ubuntu-latest
outputs:
- id: ${{ steps.pr.outputs.id }}
- ref: ${{ steps.ref.outputs.ref }}
+ id: ${{ steps.pr.outputs.value }}
+ ref: ${{ steps.ref.outputs.value }}
+ repo: ${{ steps.repo.outputs.value }}
steps:
- # Get PR ID from artifact
+ # Get PR id from artifact
- name: download pr artifact
uses: dawidd6/action-download-artifact@v2
with:
@@ -29,9 +30,9 @@ jobs:
- name: get PR id
id: pr
- run: echo "id=$(<pr-id.txt)" >> $GITHUB_OUTPUT
+ run: echo "value=$(<pr-id.txt)" >> $GITHUB_OUTPUT
- # Get PR ID from artifact
+ # Get PR ref from artifact
- name: download pr artifact
uses: dawidd6/action-download-artifact@v2
with:
@@ -41,7 +42,19 @@ jobs:
- name: get PR ref
id: ref
- run: echo "ref=$(<pr-ref.txt)" >> $GITHUB_OUTPUT
+ run: echo "value=$(<pr-ref.txt)" >> $GITHUB_OUTPUT
+
+ # Get PR repo from artifact
+ - 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-repo
+
+ - name: get PR repo
+ id: repo
+ run: echo "value=$(<pr-repo.txt)" >> $GITHUB_OUTPUT
prepare:
runs-on: ubuntu-latest
@@ -85,8 +98,9 @@ jobs:
steps:
- name: Checkout
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
with:
+ repository: ${{ needs.setup.outputs.repo }}
ref: ${{ needs.setup.outputs.ref }}
- name: Setup Node.js
@@ -129,8 +143,9 @@ jobs:
steps:
- name: Checkout
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
with:
+ repository: ${{ needs.setup.outputs.repo }}
ref: ${{ needs.setup.outputs.ref }}
- name: Setup Node.js
diff --git a/.github/workflows/release-nightly.yml b/.github/workflows/release-nightly.yml
index 5e3a34f0bb..821d8298f7 100644
--- a/.github/workflows/release-nightly.yml
+++ b/.github/workflows/release-nightly.yml
@@ -18,20 +18,19 @@ jobs:
steps:
- name: Checkout
- uses: actions/checkout@v3
-
- - name: Install pnpm
- uses: pnpm/action-setup@v2
- with:
- version: 8
- run_install: false
+ uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18
registry-url: ${{ secrets.VERDACCIO_URL }}
- cache: pnpm
+
+ - name: Install pnpm
+ uses: pnpm/action-setup@v2
+ with:
+ version: 8
+ run_install: false
- name: 📌 Get package version (version + date)
id: nightly-version
@@ -66,7 +65,7 @@ jobs:
steps:
- name: Checkout
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
- name: Setup Node.js
uses: ./.github/actions/setup-node
@@ -97,7 +96,7 @@ jobs:
steps:
- name: Checkout
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
- name: Setup Node.js
uses: ./.github/actions/setup-node
@@ -117,7 +116,6 @@ jobs:
notify:
needs: [release-nightly, build-demo, build-storybook]
runs-on: ubuntu-latest
- if: ${{ always() }}
steps:
- name: Invoke deployment hook
diff --git a/.github/workflows/release-unstable.yml b/.github/workflows/release-unstable.yml
index b8a8c2fd06..e38aa9ab9b 100644
--- a/.github/workflows/release-unstable.yml
+++ b/.github/workflows/release-unstable.yml
@@ -20,7 +20,7 @@ jobs:
steps:
- name: Checkout
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v2
@@ -69,7 +69,7 @@ jobs:
steps:
- name: Checkout
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
- name: Setup Node.js
uses: ./.github/actions/setup-node
@@ -100,7 +100,7 @@ jobs:
steps:
- name: Checkout
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
- name: Setup Node.js
uses: ./.github/actions/setup-node
@@ -121,7 +121,6 @@ jobs:
notify:
needs: [release-unstable, build-demo, build-storybook]
runs-on: ubuntu-latest
- if: ${{ always() }}
steps:
- name: Invoke deployment hook