Selaa lähdekoodia

chore: validate release examples and dependency security

lingfengQAQ 4 viikkoa sitten
vanhempi
sitoutus
83146caf07

+ 21 - 0
.github/ISSUE_TEMPLATE/docs.yml

@@ -0,0 +1,21 @@
+name: 文档问题
+description: 报告安装、命令或教程中的错误。
+title: '[Docs] '
+labels: [documentation]
+body:
+  - type: dropdown
+    id: product_line
+    attributes:
+      label: 产品线
+      options:
+        - v6(Claude Code / master)
+        - v8(DSH Scriptor / v8)
+    validations:
+      required: true
+  - type: textarea
+    id: location
+    attributes:
+      label: 文档链接、所用版本及出错步骤
+      description: 说明预期结果与实际结果,不要粘贴密钥或私人作品。
+    validations:
+      required: true

+ 3 - 0
.github/workflows/v8-ci.yml

@@ -13,6 +13,7 @@ jobs:
   quality:
     name: v8-quality-${{ matrix.node }}
     runs-on: windows-latest
+    timeout-minutes: 20
     strategy:
       fail-fast: false
       matrix:
@@ -32,6 +33,7 @@ jobs:
       - run: pnpm install --frozen-lockfile
       - run: pnpm check:public
       - run: pnpm check:version
+      - run: pnpm audit --audit-level=high
       - run: pnpm lint
       - run: pnpm test:release
       - run: pnpm test
@@ -44,6 +46,7 @@ jobs:
   portability:
     name: v8-linux-observation
     runs-on: ubuntu-latest
+    timeout-minutes: 15
     continue-on-error: true
     steps:
       - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4

+ 2 - 0
.github/workflows/v8-release.yml

@@ -10,6 +10,7 @@ concurrency:
 jobs:
   release:
     runs-on: windows-latest
+    timeout-minutes: 30
     permissions:
       contents: write
     env:
@@ -31,6 +32,7 @@ jobs:
           cache: pnpm
       - run: pnpm install --frozen-lockfile
       - run: pnpm check:version
+      - run: pnpm audit --audit-level=high
       - run: pnpm lint
       - run: pnpm test:release
       - run: pnpm test

+ 9 - 0
scripts/release/version.mjs

@@ -14,6 +14,15 @@ export function releaseVersion(directory = root, tag) {
   if (tag) assert.equal(tag, expectedTag, 'Release tag must match the package version')
   const changelog = fs.readFileSync(path.join(directory, 'CHANGELOG.md'), 'utf8')
   assert.ok(changelog.includes(`## [${bundle.version}]`), 'Missing versioned changelog entry')
+  for (const file of ['README.md', 'packages/bundle/README.md', 'docs/user/install.md', 'docs/user/upgrade-backup.md']) {
+    const text = fs.readFileSync(path.join(directory, file), 'utf8')
+    for (const match of text.matchAll(/linfengqaqtat-dsh-scriptor-([\d][\w.-]*)\.tgz/g)) {
+      assert.equal(match[1], bundle.version, `Stale installation example in ${file}`)
+    }
+    for (const match of text.matchAll(/releases\/tag\/scriptor-v([\d][\w.-]*)/g)) {
+      assert.equal(match[1], bundle.version, `Stale download link in ${file}`)
+    }
+  }
   return { version: bundle.version, tag: expectedTag, prerelease: bundle.version.includes('-'),
     packageName: bundle.name, filename: `linfengqaqtat-dsh-scriptor-${bundle.version}.tgz` }
 }