From 4f03e4a19989f9e4ec7d87e245537c54c47aa186 Mon Sep 17 00:00:00 2001 From: flycran Date: Fri, 6 Nov 2026 16:42:40 +0800 Subject: [PATCH 1/2] =?UTF-8?q?ci:=20=E8=A7=86=E8=A7=89=E5=AF=B9=E6=AF=94?= =?UTF-8?q?=E6=94=B9=E7=94=A8=20src=20=E6=A8=A1=E5=BC=8F=E9=81=BF=E5=85=8D?= =?UTF-8?q?=E7=8E=AF=E5=A2=83=E5=8F=98=E9=87=8F=E5=B9=B2=E6=89=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit dist 模式经 @actions/core 的 INPUT_* 与生产 run() 生成,贡献数据依赖 fetch 拦截;作业环境里的 GITHUB_TOKEN 会让被测版本改走官方渠道,绕过拦截并拿到实时数据。src 模式直接用 calendarList 注入固定数据,不受环境影响。base 始终是最新 main,v3.3.3 起支持 calendarList,更早版本会由工具显式报错提示。 --- .github/workflows/visual-compare.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/visual-compare.yml b/.github/workflows/visual-compare.yml index bd6730b..7ee2e25 100644 --- a/.github/workflows/visual-compare.yml +++ b/.github/workflows/visual-compare.yml @@ -60,11 +60,14 @@ jobs: working-directory: svg-compare-tool run: bun x playwright install chromium --with-deps + # 对比只针对最新 main 的 base,calendarList(v3.3.3 起)必然可用,因此走 src 模式: + # dist 模式经 @actions/core 的 INPUT_* 与 run() 生成,会受作业环境变量(如 GITHUB_TOKEN) + # 影响而偏离注入的固定数据 - name: Compare base and head visually id: compare continue-on-error: ${{ steps.major-gate.outputs.enforce == 'false' }} run: | - bun svg-compare-tool/cli.ts ci '${{ github.event.pull_request.base.sha }}' HEAD --via dist + bun svg-compare-tool/cli.ts ci '${{ github.event.pull_request.base.sha }}' HEAD --via src - name: Enforce result id: enforce From 5ab4fdcfb362e117bb14983aaf49de8b1f9118b7 Mon Sep 17 00:00:00 2001 From: flycran Date: Fri, 6 Nov 2026 16:52:28 +0800 Subject: [PATCH 2/2] =?UTF-8?q?chore:=20=E6=95=B4=E7=90=86=E8=A7=86?= =?UTF-8?q?=E8=A7=89=E5=AF=B9=E6=AF=94=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/visual-compare.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/visual-compare.yml b/.github/workflows/visual-compare.yml index 7ee2e25..cbb5b28 100644 --- a/.github/workflows/visual-compare.yml +++ b/.github/workflows/visual-compare.yml @@ -60,9 +60,7 @@ jobs: working-directory: svg-compare-tool run: bun x playwright install chromium --with-deps - # 对比只针对最新 main 的 base,calendarList(v3.3.3 起)必然可用,因此走 src 模式: - # dist 模式经 @actions/core 的 INPUT_* 与 run() 生成,会受作业环境变量(如 GITHUB_TOKEN) - # 影响而偏离注入的固定数据 + # src 模式依赖 base 支持 calendarList(v3.3.3 起),base 恒为最新 main - name: Compare base and head visually id: compare continue-on-error: ${{ steps.major-gate.outputs.enforce == 'false' }}