From f5b47b3163a3b6fbe6c1a82bac5b1c59131747c4 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 6 Aug 2026 03:45:10 +0000 Subject: [PATCH] =?UTF-8?q?fix(ci):=20=E6=8A=8A=20live-e2e=20=E7=9A=84=20r?= =?UTF-8?q?unner.temp=20=E7=A7=BB=E5=87=BA=20job=20=E7=BA=A7=20env,?= =?UTF-8?q?=E4=BF=AE=E6=8E=89=E5=85=A8=E5=88=86=E6=94=AF=20startup=20failu?= =?UTF-8?q?re?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit .github/workflows/live-e2e.yml 自 #3325 落地起就从未跑起来过一次:它在 job 级 env 里写了 `LIVE_BACKEND_DIR: ${{ runner.temp }}/live-backend`,而 `runner` 上下文在 job 级 env 求值时尚不存在(GitHub 的 contexts availability 表在此处只允许 github / inputs / matrix / needs / secrets / strategy / vars)。这不是某个 step 失败,而是**整份 workflow 文件校验不 通过**,于是 GitHub 无法解析 `on:` 就先判定文件非法,对每一次 push 都记 一条 0 job / 0s 的 startup failure —— 包括 gh-readonly-queue/* 合并队列 分支,把每个 PR 和每次 main push 的 checks 列表都染红一格。 两个由此推出的事实: 1. `continue-on-error: true` 救不了它。那是 job 级属性,而这里根本没有 任何 job 被创建,红色出在 workflow 启动阶段。 2. 该 lane 从未真正冒烟测试过任何东西。按 `pull_request` 事件过滤,这个 workflow 的历史 run 数是 **0**;它声明的 push 触发器压根不存在,所有 182 个 run 编号全是 push 上的 startup failure 噪声。 修法保持最小:job 级 env 只留三个字面量;`LIVE_BACKEND_DIR` 下沉到唯一 消费它的 "Start ObjectStack backend" step 的 step 级 env —— 那里读 `runner` 是合法的。cache 的 `path:`/`key:` 与 artifact 上传的 `path:` 本 就在 `with:` 里,一直合法,未动。同时在 job 级 env 上方留下一段告警注释, 避免下一个人把它挪回去。 验证(actionlint v1.7.7,方向在跑之前先行预测): - origin/main 原文件 → `live-e2e.yml:61:29: context "runner" is not allowed here` (exit 1) - 本次修改后 → 无告警 (exit 0) - 对 .github/workflows/*.yml 全量跑 → exit 0,说明 live-e2e.yml 是仓库 里唯一一份校验不过的 workflow,与 issue 观察到的"只有这一格红"吻合。 纯 CI bug 修复、不触及任何已发布包,按 AGENTS.md:151 不需要 changeset。 Fixes #3425 Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01GTRjn8xBqp75dk7kFupVRt --- .github/workflows/live-e2e.yml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/live-e2e.yml b/.github/workflows/live-e2e.yml index d6df28c40e..204be323fe 100644 --- a/.github/workflows/live-e2e.yml +++ b/.github/workflows/live-e2e.yml @@ -57,8 +57,16 @@ jobs: # Non-blocking by construction — see the header comment before touching. continue-on-error: true + # ⚠️ Do NOT add a `runner.*` expression to this job-level `env:` block. + # The `runner` context does not exist yet when job-level env is evaluated + # (GitHub's "contexts availability" table allows only github / needs / + # strategy / matrix / vars / secrets / inputs here). One `${{ runner.temp }}` + # in this block fails the whole FILE at validation time — 0 jobs, 0s, + # "startup failure" — and `continue-on-error` cannot soften it because no + # job is ever created. Need a runner path? Use the `$RUNNER_TEMP` + # environment variable inside a `run:` step, or a step-level `env:` / + # `with:` (both may read `runner`). See the LIVE_BACKEND_DIR step below. env: - LIVE_BACKEND_DIR: ${{ runner.temp }}/live-backend LIVE_BACKEND_PORT: '4010' LIVE_API_URL: http://localhost:4010 LIVE_APP_URL: http://localhost:5190 @@ -91,6 +99,12 @@ jobs: key: live-backend-${{ runner.os }}-${{ hashFiles('e2e/live/ci/backend.env') }} - name: Start ObjectStack backend (published packages) + # Step-level env — `runner` IS available here (unlike job-level env). + # Must resolve to the same path as the cache step's `path:` above and + # the artifact upload's `path:` below, or the cache silently stops + # hitting; keep the three in sync. + env: + LIVE_BACKEND_DIR: ${{ runner.temp }}/live-backend run: bash e2e/live/ci/start-backend.sh - name: Build console