Skip to content

Commit 435504b

Browse files
committed
chore: merge main
2 parents 5017e40 + 4d01112 commit 435504b

File tree

300 files changed

+5732
-3349
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

300 files changed

+5732
-3349
lines changed

.github/renovate.json5

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"labels": ["dependencies"],
55
"ignorePaths": ["**/__tests__/**"],
66
"rangeStrategy": "bump",
7+
"postUpdateOptions": ["pnpmDedupe"],
78
"packageRules": [
89
{
910
"matchDepTypes": ["peerDependencies"],

.github/workflows/ci.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ jobs:
3939

4040
steps:
4141
- name: Checkout
42-
uses: actions/checkout@v4
42+
uses: actions/checkout@v5
4343
with:
4444
# Assume PRs are less than 50 commits
4545
fetch-depth: 50
4646

4747
- name: Get changed files
4848
id: changed-files
49-
uses: tj-actions/changed-files@a284dc1814e3fd07f2e34267fc8f81227ed29fb8 # v45.0.9
49+
uses: tj-actions/changed-files@24d32ffd492484c1d75e0c0b894501ddb9d30d62 # v47.0.0
5050
with:
5151
files: |
5252
docs/**
@@ -75,13 +75,13 @@ jobs:
7575
name: "Build&Test: node-${{ matrix.node_version }}, ${{ matrix.os }}"
7676
steps:
7777
- name: Checkout
78-
uses: actions/checkout@v4
78+
uses: actions/checkout@v5
7979

8080
- name: Install pnpm
81-
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
81+
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
8282

8383
- name: Set node version to ${{ matrix.node_version }}
84-
uses: actions/setup-node@v4
84+
uses: actions/setup-node@v6
8585
with:
8686
node-version: ${{ matrix.node_version }}
8787
cache: "pnpm"
@@ -148,13 +148,13 @@ jobs:
148148
runs-on: ubuntu-latest
149149
name: "Lint: node-22, ubuntu-latest"
150150
steps:
151-
- uses: actions/checkout@v4
151+
- uses: actions/checkout@v5
152152

153153
- name: Install pnpm
154-
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
154+
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
155155

156156
- name: Set node version to 22
157-
uses: actions/setup-node@v4
157+
uses: actions/setup-node@v6
158158
with:
159159
node-version: 22
160160
cache: "pnpm"

.github/workflows/copilot-setup-steps.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ jobs:
1414
contents: write
1515
steps:
1616
- name: Checkout
17-
uses: actions/checkout@v4
17+
uses: actions/checkout@v5
1818

1919
- name: Install pnpm
20-
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
20+
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
2121

2222
- name: Set node version to 22
23-
uses: actions/setup-node@v4
23+
uses: actions/setup-node@v6
2424
with:
2525
node-version: 22
2626
cache: "pnpm"

.github/workflows/ecosystem-ci-trigger.yml

Lines changed: 50 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ jobs:
99
runs-on: ubuntu-latest
1010
if: github.repository == 'vitejs/vite' && github.event.issue.pull_request && startsWith(github.event.comment.body, '/ecosystem-ci run')
1111
permissions:
12-
issues: write # to add / delete reactions
12+
issues: write # to add / delete reactions, post comments
1313
pull-requests: write # to read PR data, and to add labels
1414
actions: read # to check workflow status
1515
contents: read # to clone the repo
1616
steps:
1717
- name: Check User Permissions
18-
uses: actions/github-script@v7
18+
uses: actions/github-script@v8
1919
id: check-permissions
2020
with:
2121
script: |
@@ -56,7 +56,7 @@ jobs:
5656
}
5757
5858
- name: Get PR Data
59-
uses: actions/github-script@v7
59+
uses: actions/github-script@v8
6060
id: get-pr-data
6161
with:
6262
script: |
@@ -66,6 +66,37 @@ jobs:
6666
repo: context.repo.repo,
6767
pull_number: context.issue.number
6868
})
69+
70+
const commentCreatedAt = new Date(context.payload.comment.created_at)
71+
const commitPushedAt = new Date(pr.head.repo.pushed_at)
72+
73+
console.log(`Comment created at: ${commentCreatedAt.toISOString()}`)
74+
console.log(`PR last pushed at: ${commitPushedAt.toISOString()}`)
75+
76+
// Check if any commits were pushed after the comment was created
77+
if (commitPushedAt > commentCreatedAt) {
78+
const errorMsg = [
79+
'⚠️ Security warning: PR was updated after the trigger command was posted.',
80+
'',
81+
`Comment posted at: ${commentCreatedAt.toISOString()}`,
82+
`PR last pushed at: ${commitPushedAt.toISOString()}`,
83+
'',
84+
'This could indicate an attempt to inject code after approval.',
85+
'Please review the latest changes and re-run /ecosystem-ci run if they are acceptable.'
86+
].join('\n')
87+
88+
core.setFailed(errorMsg)
89+
90+
await github.rest.issues.createComment({
91+
owner: context.repo.owner,
92+
repo: context.repo.repo,
93+
issue_number: context.issue.number,
94+
body: errorMsg
95+
})
96+
97+
throw new Error('PR was pushed to after comment was created')
98+
}
99+
69100
core.setOutput('head_sha', pr.head.sha)
70101
return {
71102
num: context.issue.number,
@@ -75,7 +106,7 @@ jobs:
75106
}
76107
77108
- name: Check Package Existence
78-
uses: actions/github-script@v7
109+
uses: actions/github-script@v8
79110
id: check-package
80111
with:
81112
script: |
@@ -109,12 +140,14 @@ jobs:
109140
110141
- name: Trigger Preview Release (if Package Not Found)
111142
if: fromJSON(steps.check-package.outputs.result).exists == false
112-
uses: actions/github-script@v7
143+
uses: actions/github-script@v8
113144
id: trigger-preview-release
145+
env:
146+
PR_DATA: ${{ steps.get-pr-data.outputs.result }}
114147
with:
115148
github-token: ${{ steps.generate-token.outputs.token }}
116149
script: |
117-
const prData = ${{ steps.get-pr-data.outputs.result }}
150+
const prData = JSON.parse(process.env.PR_DATA)
118151
console.log('Package not found, triggering preview release...')
119152
120153
// Add label "trigger: preview" to the PR
@@ -128,12 +161,15 @@ jobs:
128161
129162
- name: Wait for Preview Release Completion (if Package Not Found)
130163
if: fromJSON(steps.check-package.outputs.result).exists == false
131-
uses: actions/github-script@v7
164+
uses: actions/github-script@v8
132165
id: wait-preview-release
166+
env:
167+
PR_DATA: ${{ steps.get-pr-data.outputs.result }}
168+
REACTION: ${{ fromJSON(steps.check-package.outputs.result).reaction }}
133169
with:
134170
script: |
135-
const prData = ${{ steps.get-pr-data.outputs.result }}
136-
const reaction = ${{ fromJSON(steps.check-package.outputs.result).reaction }}
171+
const prData = JSON.parse(process.env.PR_DATA)
172+
const reaction = +process.env.REACTION
137173
const workflowFileName = 'preview-release.yml'
138174
const workflow = await github.rest.actions.getWorkflow({
139175
owner: context.repo.owner,
@@ -195,34 +231,22 @@ jobs:
195231
}
196232
197233
- name: Checkout
198-
uses: actions/checkout@v4
234+
uses: actions/checkout@v5
199235
with:
200236
ref: refs/pull/${{ fromJSON(steps.get-pr-data.outputs.result).num }}/head
201237
fetch-depth: 0
202238

203-
# This step can be removed on May 26 2025
204-
- name: Check Commit Hash Ambiguity
205-
id: check_ambiguity
206-
run: |
207-
HEAD_SHA=${{ steps.get-pr-data.outputs.head_sha }}
208-
COMMIT_SHORT=${HEAD_SHA:0:7}
209-
210-
if git show "$COMMIT_SHORT"; then
211-
echo "COLLISION=false" >> $GITHUB_ENV
212-
else
213-
echo "COLLISION=true" >> $GITHUB_ENV
214-
fi
215-
216239
- name: Trigger Downstream Workflow
217-
uses: actions/github-script@v7
240+
uses: actions/github-script@v8
218241
id: trigger
219242
env:
220243
COMMENT: ${{ github.event.comment.body }}
244+
PR_DATA: ${{ steps.get-pr-data.outputs.result }}
221245
with:
222246
github-token: ${{ steps.generate-token.outputs.token }}
223247
script: |
224248
const comment = process.env.COMMENT.trim()
225-
const prData = ${{ steps.get-pr-data.outputs.result }}
249+
const prData = JSON.parse(process.env.PR_DATA)
226250
227251
const suite = comment.split('\n')[0].replace(/^\/ecosystem-ci run/, '').trim()
228252
@@ -235,7 +259,7 @@ jobs:
235259
prNumber: '' + prData.num,
236260
branchName: prData.branchName,
237261
repo: prData.repo,
238-
commit: process.env.COLLISION === 'false' ? prData.commit : '',
262+
commit: prData.commit,
239263
suite: suite === '' ? '-' : suite
240264
}
241265
})

.github/workflows/issue-close-require.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
pull-requests: write # for actions-cool/issues-helper to update PRs
1414
steps:
1515
- name: needs reproduction
16-
uses: actions-cool/issues-helper@50068f49b7b2b3857270ead65e2d02e4459b022c # v3
16+
uses: actions-cool/issues-helper@45d75b6cf72bf4f254be6230cb887ad002702491 # v3
1717
with:
1818
actions: "close-issues"
1919
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/issue-labeled.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
steps:
1515
- name: contribution welcome
1616
if: github.event.label.name == 'contribution welcome' || github.event.label.name == 'help wanted'
17-
uses: actions-cool/issues-helper@50068f49b7b2b3857270ead65e2d02e4459b022c # v3
17+
uses: actions-cool/issues-helper@45d75b6cf72bf4f254be6230cb887ad002702491 # v3
1818
with:
1919
actions: "remove-labels"
2020
token: ${{ secrets.GITHUB_TOKEN }}
@@ -23,7 +23,7 @@ jobs:
2323

2424
- name: remove pending
2525
if: (github.event.label.name == 'enhancement' || contains(github.event.label.description, '(priority)')) && contains(github.event.issue.labels.*.name, 'pending triage')
26-
uses: actions-cool/issues-helper@50068f49b7b2b3857270ead65e2d02e4459b022c # v3
26+
uses: actions-cool/issues-helper@45d75b6cf72bf4f254be6230cb887ad002702491 # v3
2727
with:
2828
actions: "remove-labels"
2929
token: ${{ secrets.GITHUB_TOKEN }}
@@ -32,7 +32,7 @@ jobs:
3232

3333
- name: needs reproduction
3434
if: github.event.label.name == 'needs reproduction'
35-
uses: actions-cool/issues-helper@50068f49b7b2b3857270ead65e2d02e4459b022c # v3
35+
uses: actions-cool/issues-helper@45d75b6cf72bf4f254be6230cb887ad002702491 # v3
3636
with:
3737
actions: "create-comment, remove-labels"
3838
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/lock-closed-issues.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ jobs:
1212
if: github.repository == 'vitejs/vite'
1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: dessant/lock-threads@1bf7ec25051fe7c00bdd17e6a7cf3d7bfb7dc771 # v5
15+
- uses: actions-cool/issues-helper@45d75b6cf72bf4f254be6230cb887ad002702491 # v3
1616
with:
17-
github-token: ${{ secrets.GITHUB_TOKEN }}
18-
issue-inactive-days: "14"
19-
#issue-comment: |
17+
actions: "lock-issues"
18+
token: ${{ secrets.GITHUB_TOKEN }}
19+
#body: |
2020
# This issue has been locked since it has been closed for more than 14 days.
2121
#
2222
# If you have found a concrete bug or regression related to it, please open a new [bug report](https://github.com/vitejs/vite/issues/new/choose) with a reproduction against the latest Vite version. If you have any other comments you should join the chat at [Vite Land](https://chat.vite.dev) or create a new [discussion](https://github.com/vitejs/vite/discussions).
23-
issue-lock-reason: ""
24-
process-only: "issues"
23+
issue-state: closed
24+
inactive-day: 14

.github/workflows/preview-release.yml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,26 @@ jobs:
2323
runs-on: ubuntu-latest
2424
steps:
2525
- name: Checkout code
26-
uses: actions/checkout@v4
26+
uses: actions/checkout@v5
2727

2828
- name: Install pnpm
29-
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
29+
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
3030

31-
- name: Install dependencies
31+
- name: Set node version to 22
32+
uses: actions/setup-node@v6
33+
with:
34+
node-version: 22
35+
registry-url: https://registry.npmjs.org/
36+
# disable cache, to avoid cache poisoning (https://docs.zizmor.sh/audits/#cache-poisoning)
37+
package-manager-cache: false
38+
39+
- name: Disallow installation scripts
40+
run: yq '.onlyBuiltDependencies = []' -i pnpm-workspace.yaml
41+
42+
- name: Install deps
3243
run: pnpm install
44+
env:
45+
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: "1"
3346

3447
- name: Build
3548
working-directory: ./packages/vite

.github/workflows/publish.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,28 @@ jobs:
1818
environment: Release
1919
steps:
2020
- name: Checkout
21-
uses: actions/checkout@v4
21+
uses: actions/checkout@v5
2222

2323
- name: Install pnpm
24-
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
24+
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
2525

2626
- name: Set node version to 22
27-
uses: actions/setup-node@v4
27+
uses: actions/setup-node@v6
2828
with:
2929
node-version: 22
3030
registry-url: https://registry.npmjs.org/
31-
cache: "pnpm"
31+
# disable cache, to avoid cache poisoning (https://docs.zizmor.sh/audits/#cache-poisoning)
32+
package-manager-cache: false
33+
34+
- name: Disallow installation scripts
35+
run: yq '.onlyBuiltDependencies = []' -i pnpm-workspace.yaml
3236

3337
- name: Install deps
3438
run: pnpm install
3539
env:
3640
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: "1"
3741

3842
- name: Publish package
39-
run: pnpm run ci-publish ${{ github.ref_name }}
43+
run: npm i -g npm@^11.5.2 && pnpm run ci-publish "$REF_NAME"
4044
env:
41-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
45+
REF_NAME: ${{ github.ref_name }}

.github/workflows/release-tag.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
- "plugin-*" # Push events to matching plugin-*, i.e. plugin-(vue|vue-jsx|react|legacy)@1.0.0
88
- "create-vite*" # # Push events to matching create-vite*, i.e. create-vite@1.0.0
99

10-
# $GITHUB_REF_NAME - https://docs.github.com/en/actions/learn-github-actions/environment-variables#default-environment-variables
10+
# $GITHUB_REF_NAME - https://docs.github.com/en/actions/reference/workflows-and-actions/variables#default-environment-variables
1111

1212
jobs:
1313
release:
@@ -16,7 +16,7 @@ jobs:
1616
permissions:
1717
contents: write # for yyx990803/release-tag to create a release tag
1818
steps:
19-
- uses: actions/checkout@v4
19+
- uses: actions/checkout@v5
2020

2121
- name: Get pkgName for tag
2222
id: tag
@@ -41,7 +41,7 @@ jobs:
4141
# only run if tag is not alpha
4242
if: steps.tag.outputs.pkgName
4343
id: release_tag
44-
uses: yyx990803/release-tag@master
44+
uses: yyx990803/release-tag@8cccf7c5aa332d71d222df46677f70f77a8d2dc0 # v1.0.0
4545
env:
4646
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4747
with:

0 commit comments

Comments
 (0)