Skip to content

ci: 本仓 PR 唯一 test 门禁与 workflow 策略自测 - #21

Merged
RiriAgent merged 2 commits into
tree/mouriya-devops-ci-16from
issue-17-pr-test
Nov 26, 2026
Merged

RiriAgent merged 2 commits into
tree/mouriya-devops-ci-16from
issue-17-pr-test

Conversation

@RiriAgent

@RiriAgent RiriAgent commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Closes #17

摘要

本仓新增 .github/workflows/pr.yml,在 pull_request(main、tree/**)与 merge_group 上由托管 runner 的单 job test 执行 mise run check:pr;self-check.yml 收窄为 main/tree/** 的 push 检查。mise.toml 把 actionlint 与新增的 selftest/workflows/policy.test.ts 一起纳入 check:pr,check 改为它的依赖;策略自测扫描全仓 workflow 与 action,并实际执行三个 parse 脚本与 actions/mise-check/guard.sh,证明跨仓 fork PR 被拒。仓库合并开关已收敛为仅 squash 并自动删除分支。

实现说明

不变边界

  • actions/mise-check/action.yml、actions/mise-check/guard.sh、.github/workflows/check.yml、image.yml、release-artifact.yml 不在 git diff 7a922e8 b8f5daa 中;新增的策略自测只读取并执行它们,不修改其行为(结果 1)。
  • self-check.yml 的改动只在 on:jobs.check.uses: ./.github/workflows/check.yml 与 permissions: contents: read 逐字未改,pull_request: 触发被删除,push 增加 branches: [main, 'tree/**'](结果 2)。
  • 合入后的检查面不缩小:原来的 [tasks.check] run = "actionlint" 被 check:pr(actionlint && bun test selftest)完整包含,[tasks.check] 只保留 depends = ["check:pr"],命令不在两处重复维护(结果 1、2)。
  • selftest:task、build、release 三个 fixture task 与 selftest/image、selftest/release 脚本未改。
  • 结果 3 是仓库级设置,不在本 diff 内:当前仓库为 allow_squash_merge: true、allow_merge_commit: false、allow_rebase_merge: false、delete_branch_on_merge: true;main 没有分支保护,rulesets 为空,所以对外声明的唯一必过门禁只有 test。

机制

  • 门禁接线:.github/workflows/pr.yml 的 on.pull_request.branches 是 [main, 'tree/**'],另有 merge_group;permissions 只有 contents: read;concurrency.group 为 pr-${{ github.event.pull_request.number || github.ref }} 且 cancel-in-progress: true。唯一 job 是 test,name: test、runs-on: ubuntu-24.04、timeout-minutes: 10,步骤为 actions/checkout@main(persist-credentials: false)与 ./actions/mise-check(task: check:pr)。
  • 精确的 CheckRun 名:actions/mise-check 是 composite action,作为 test job 的步骤执行,不经 workflow_call,因此 CheckRun 名就是 job 的 name: test,没有 <caller> / <callee> 前缀;selftest/workflows/policy.test.ts 的 pr.yml > exposes exactly one hosted job named test 固定这一点。
  • 本地 action 引用:pr.yml 用 ./actions/mise-check 而不是 mouriya-devops/ci/actions/mise-check@main。与 @main 引用相比,CheckRun 名仍精确为 test、task 输入面完全相同,而本仓改动 actions/mise-check 的 PR 由自己的 test 真实执行,不必等合入 main 后才生效。
  • 策略自测:selftest/workflows/policy.test.ts 用 Bun.Glob 收集 .github/workflows/*.yml 与 actions/**/*.yml,walk 遍历全部 mapping 后断言:外部 uses 只跟 @main;每个 actions/checkout@ 显式 persist-credentials: false;pr.yml 的触发键恰为 merge_group + pull_request、分支恰为 ["main", "tree/**"]、恰有一个 job test、runs-on: ubuntu-24.04、task: check:pr、整个文件没有 paths / paths-ignore / continue-on-error;self-check.yml 只剩 push 且分支为 ["main", "tree/**"](结果 1、2)。
  • 跨仓拒绝不是文本片段断言:runScript 把 check.yml、image.yml、release-artifact.yml 的 parse 步骤 run: 写进临时目录,用必失败的 gh、docker、skopeo(以及除 release-artifact 外的 curl)桩替换外部命令,在 bash --noprofile --norc -eo pipefail 下执行;probes 对 pull_request 与 pull_request_target、["self-hosted","linux"] 与 ["Self-Hosted","linux"] 的每种组合要求非零退出并带拒绝消息,对 ["ubuntu-24.04"] 要求放行。发现性断言要求被探测的 workflow 集合恰好等于所有 job 级 runs-on 含 ${{ 的 workflow(结果 1)。
  • actions/mise-check/guard.sh 按其源码执行:fork PR 在 self-hosted 与无法确认的 runner 上被拒,在 github-hosted 上放行,同仓 PR 在 self-hosted 上放行(结果 1)。
  • 任务面:[tasks."check:pr"] run = "actionlint && bun test selftest",[tasks.check] depends = ["check:pr"];[tools] 增加 bun = "latest"。pr.yml 只调 check:pr,合入后的 self-check.yml 仍调 check。

契约

  • 对外只声明一个必过 PR 检查,CheckRun 名 test,由 job 的 name 固定,不是 workflow_call 派生名。缓冲分支 PR 的 head SHA 本身是 tree/** 的 push 目标,所以这个 head 上除 test 外还会出现 self-check.yml → check.yml 产出的 check / parse 与 check / check,它们来自 push 事件而不是 PR 触发器;仓库没有分支保护与 rulesets,唯一声明的门禁仍是 test。
  • ./actions/mise-check 消费的是前置 ci:新增顶层 test 门禁 composite action actions/mise-check 与 check.yml task 参数 #19 交付的 task 输入,本地没有复制或重定义 action 内部逻辑;消费仓仍按 mouriya-devops/ci/actions/mise-check@main 引用同一个 action。
  • 本仓入口是 mise run check:pr 与 mise run check 两个任务名:pr.yml 与 self-check.yml 只按任务名调用,check 恒等于 check:pr 的集合。
  • README.md 的「## 检查」只记录这两个入口与各自触发器,不写实现细节。

切换

  • PR 上的自检由 self-check.yml 的 pull_request 触发删除而停止:PR 分支原来经 workflow_call 产出的 check / parse、check / check 由 pr.yml 的单一 test 取代(结果 2,对应「不应残留」中「在 PR 上产出 check / check 而非顶层 test 的旧触发器」)。
  • main 与 tree/** 的 push 检查按 issue Anchor 保留:self-check.yml 的 jobs.check 继续调 check.yml,合入后仍在 push 上产出 check / parse 与 check / check。
  • mise.toml 的 [tasks.check] description 与实现同步改写;README.md 新增「## 检查」两条要点(PR 与 merge_group 走 test,main/tree/** push 走 self-check.yml)。

阅读入口

中心逻辑在 selftest/workflows/policy.test.ts:collectUses 的扫描、pr.yml 与 self-check.yml 的结构断言、probes + runScript 的跨仓拒绝执行,以及 mise tasks 断言。.github/workflows/pr.yml 是 27 行接线;mise.toml 与 README.md 是配置与说明。

实现选择与偏离

分叉 裁决 依据 被否方案及否决理由
pr.yml 引用本地 ./actions/mise-check 还是 mouriya-devops/ci/actions/mise-check@main 本地路径 composite action 在 job 内执行,CheckRun 名仍精确为 test;本仓改动 action 的 PR 由自己的 test 真实执行 @main:本仓对 actions/mise-check 的改动要等合入 main 后才被执行,PR 上测不到
check:pr 是否包含 actionlint 包含:actionlint && bun test selftest PR 门禁必须覆盖改动前的 actionlint(含 shellcheck)检查面;check 用 depends 复用同一命令 check:pr 只跑策略自测:PR 不再检查 YAML 语法与 shellcheck,是既有能力回退
策略自测的运行方式 bun test selftest,用 Bun.YAML / Bun.TOML / Bun.Glob / Bun.spawnSync Bun 已作为本仓工具链加入,内建解析器免去额外 YAML 依赖,离线可跑 引入 js-yaml 或其他测试框架:多一份依赖与安装步骤,selftest 不再是单命令

未验证与风险

  • merge_group 触发未真实执行:仓库没有启用 merge queue、没有分支保护与 rulesets,merge_group 事件不会产生;它只由策略测试固定在 pr.yml 的触发键里。pull_request 路径已在本 PR 上真实运行,b8f5daa 上只有一条顶层 test(success)。
  • 跨仓拒绝的探针直接执行各 parse 步骤的 run: 脚本,依赖宿主的 jq、openssl、sed、tr、bash(curl 用桩);mise.toml 只声明 actionlint、shellcheck、bun,这些解析器来自 runner 镜像而非 mise,未在 ubuntu-24.04 之外的环境验证。
  • 发现性断言只覆盖 job 级 runs-on 含 ${{ 的 workflow;将来新增一个静态 self-hosted job 的 workflow 不会被要求探测(结果 1 未要求,超出本 issue)。
  • 结果 3 是仓库级设置,没有仓库内测试守护;把合并方式改回 merge/rebase 或关掉合并后删分支,mise run check 不会失败。

- Add .github/workflows/pr.yml: pull_request on main and tree/** plus merge_group, one hosted job named test running ./actions/mise-check with task check:pr
- Restrict self-check.yml to push on main and tree/** so pull requests no longer produce check / check
- Add selftest/workflows/policy.test.ts: offline bun test over .github/workflows/*.yml and actions/**/*.yml for unpinned external refs, persist-credentials: false, pr.yml path filters and continue-on-error, and the cross-repo self-hosted rejection
- Add mise task check:pr and run the policy self-test from check, which keeps actionlint
- Refs #17
…eck:pr

- policy test executes the parse scripts of check.yml, image.yml and release-artifact.yml and guard.sh under fork and same-repo/hosted inputs; workflows with caller-controlled runs-on must be probed
- check:pr runs actionlint (with shellcheck) before the policy test; check depends on check:pr

Refs #17
@RiriAgent

Copy link
Copy Markdown
Contributor Author

证据包

由 ghc 生成 · issue #17 · 结果摘要 1cb67cacd1a2 · 3/3 条结果齐全 · 未观察的面 无 · 生成于 2026-11-26T17:12:00.536Z
检出 b8f5daa

结果 类型 面 步骤 状态 命令 记录
1 新 service request 已记录 echo "head $(git rev-parse HEAD)" echo "== mise run check:pr ==" mise run check:pr echo "check:pr exit=$?" echo "== mise run check ==" mise run check echo "check exit=$?" exit 0 · 1.7s
1 新 service log 已记录 echo "head $(git rev-parse HEAD)" base=$(mktemp -d /tmp/ci16/fx17.XXXXXX) for n in pinned nopersist paths coe noreject; do d=$base/$n git -c advice.detachedHead=false clone --local -q /tmp/ci16/ev17-head "$d" git -C "$d" apply /tmp/ci16/ev17-mutations/$n.patch echo "== $n ==" git -C "$d" diff -U0 | grep -E "^[-+][^-+]" ( cd "$d" && mise trust >/dev/null 2>&1 && mise run check:pr > "$base/$n.log" 2>&1; echo "[$n] exit=$?" ) grep -E "^\(fail\)" "$base/$n.log" done exit 0 · 3.8s
2 改 service before 已记录 git rev-parse HEAD git ls-tree --name-only HEAD .github/workflows/ git show HEAD:.github/workflows/self-check.yml grep -n "^ [a-z]*:$" .github/workflows/check.yml exit 0 · 0.0s
2 改 service request 已记录 echo "head $(git rev-parse HEAD)" echo "== pr.yml ==" nl -ba .github/workflows/pr.yml echo "== self-check.yml 3-5 ==" nl -ba .github/workflows/self-check.yml | sed -n "3,5p" exit 0 · 0.0s
2 改 service log 已记录 echo "== head ==" git rev-parse HEAD echo "== gh pr checks 21 ==" gh pr checks 21 -R mouriya-devops/ci echo "== check-runs for head ==" gh api repos/mouriya-devops/ci/commits/b8f5daa9de5aed194afd3b9685484ddbd1cf9f11/check-runs --jq ".check_runs[] | \"\(.name)\t\(.status)\t\(.conclusion // \"-\")\"" echo "== workflow runs for head ==" gh api "repos/mouriya-devops/ci/actions/runs?head_sha=b8f5daa9de5aed194afd3b9685484ddbd1cf9f11" --jq ".workflow_runs[] | \"\(.name)\t\(.event)\t\(.status)\t\(.conclusion // \"-\")\"" exit 0 · 2.1s
3 改 service before 已记录 echo "base $(git rev-parse HEAD)" echo "== .github/workflows at base ==" git ls-tree --name-only HEAD .github/workflows/ echo "== repo-settings declarations in base tree ==" git grep -n -E "allow_squash_merge|allow_merge_commit|allow_rebase_merge|delete_branch_on_merge" HEAD || echo "none" exit 0 · 0.0s
3 改 service request 已记录 echo "head $(git rev-parse HEAD)" gh api repos/mouriya-devops/ci --jq "{allow_squash_merge, allow_merge_commit, allow_rebase_merge, delete_branch_on_merge}" exit 0 · 0.5s
3 改 service log 已记录 echo "head $(git rev-parse HEAD)" gh repo view mouriya-devops/ci --json squashMergeAllowed,mergeCommitAllowed,rebaseMergeAllowed,deleteBranchOnMerge exit 0 · 0.4s

结果 1 · 新功能 · service

本仓新增确定性 workflow 策略自测并纳入 mise run check:pr 与 mise run check,扫描本仓全部 .github/workflows/*.yml 与 actions/**/*.yml,校验:外部 action 引用无版本钉死、所有 actions/checkout 显式声明 persist-credentials: false、pr.yml 不含 paths/paths-ignore 与 continue-on-error: true、自建池跨仓 PR 拒绝逻辑存在;人为制造任一违例时自测非零退出。

  • 改动后 · request(b8f5daa,记录 20261126T170951Z-3f3a11)看点:head b8f5daa 上 mise run check:pr 退出 0 并跑出 bun test 的 20 pass(含 workflow 策略自测);mise run check 先执行依赖 check:pr 再结束,退出 0,说明新自测同时接在两个入口上。
  • 改动后 · log(b8f5daa,记录 20261126T171004Z-499a2e)看点:五个 b8f5daa 的本地副本各注入一处违例(见每个 ==名称== 下的 -/+ 行:钉 @v4、去掉 persist-credentials、加 paths-ignore、加 continue-on-error、删掉 check.yml 的 fork PR 拒绝块),每处 mise run check:pr 都 exit=1,且 (fail) 行指名对应策略用例,说明自测对每类违例都非零退出。

结果 2 · 改功能(前后对比) · service

本仓 .github/workflows/pr.yml 在 pull_request 与 merge_group 上调用 actions/mise-check 产出唯一顶层 CheckRun test,旧 self-check.yml 不再在 PR 分支上重复触发 check / check。

  • 改动前 · before(7a922e8,记录 20261126T170836Z-4d853c)看点:base 7a922e8 的 .github/workflows/ 列表中没有 pr.yml;self-check.yml 第 4–5 行 on 含 push 与 pull_request,jobs.check 第 11–12 行用 workflow_call 调用 check.yml,其 jobs 为 parse 与 check,因此本仓 PR 上产出 caller 前缀的 check / parse 与 check / check,没有顶层 test。
  • 改动后 · request(b8f5daa,记录 20261126T171049Z-32a9d5)看点:pr.yml 第 3–6 行 on 只有 pull_request(branches: [main, tree/])与 merge_group;第 15–17 行 jobs 只有 test 且 name: test;第 25–27 行调用 ./actions/mise-check 且 task: check:pr,因此本仓 PR 只产出顶层 test;self-check.yml 第 3–5 行 on 只剩 push(branches: [main, tree/]),不再有 pull_request。
  • 改动后 · log(b8f5daa,记录 20261126T170850Z-73f4e0)看点:head b8f5daa 上 check-runs 只列出顶层 test;workflow runs 只有 PR Check 且 event 为 pull_request,self-check 没有在 PR 分支上触发,因此不存在 check / check 或 check / parse。

结果 3 · 改功能(前后对比) · service

本仓 GitHub 合并开关收敛为 allow_squash_merge: true、allow_merge_commit: false、allow_rebase_merge: false、delete_branch_on_merge: true。

  • 改动前 · before(7a922e8,记录 20261126T171024Z-e512c5)看点:base 7a922e8 的 .github/workflows 列表与整树 grep 都没有 allow_squash_merge/allow_merge_commit/allow_rebase_merge/delete_branch_on_merge 声明:合并开关只存在于 GitHub 设置,旧值无法从 base 提交回看,也无法经 API 历史回溯,本记录不含旧读数。
  • 改动后 · request(b8f5daa,记录 20261126T171025Z-aee1d2)看点:gh api 读回四项设置:allow_squash_merge=true、allow_merge_commit=false、allow_rebase_merge=false、delete_branch_on_merge=true;设置为 GitHub 侧状态,不在本 PR 的 diff 中,读数为采集时的实时值。
  • 改动后 · log(b8f5daa,记录 20261126T171030Z-f27e7b)看点:gh repo view(GraphQL)独立读回四字段:squashMergeAllowed=true、mergeCommitAllowed=false、rebaseMergeAllowed=false、deleteBranchOnMerge=true,与 REST 读回一致,只剩 squash 且合入后自动删分支。
结果 2 before · exit 0 · git rev-parse HEAD git ls-tree --name-only HEAD .github/workflows/ git show HEAD:.github/workflows/self-check.yml grep -n "^ [a-z]*:$" .github/workflows/check.yml

cwd /private/tmp/ci16/ev17-base · /bin/sh · 2026-11-26T17:08:36.167Z – 2026-11-26T17:08:36.190Z · 工作区干净 · 记录 20261126T170836Z-4d853c

stdout(共 22 行):

7a922e847fb372c1dab8a086826d42cef773c91a
.github/workflows/check.yml
.github/workflows/image.yml
.github/workflows/release-artifact.yml
.github/workflows/self-check.yml
.github/workflows/selftest-check.yml
.github/workflows/selftest-image.yml
.github/workflows/selftest-release.yml
name: self-check

on:
  push:
  pull_request:

permissions:
  contents: read

jobs:
  check:
    uses: ./.github/workflows/check.yml
30:  parse:
74:  check:
结果 2 log · exit 0 · echo "== head ==" git rev-parse HEAD echo "== gh pr checks 21 ==" gh pr checks 21 -R mouriya-devops/ci echo "== check-runs for head ==" gh api repos/mouriya-devops/ci/commits/b8f5daa9de5aed194afd3b9685484ddbd1cf9f11/check-runs --jq ".check_runs[] | \"\(.name)\t\(.status)\t\(.conclusion // \"-\")\"" echo "== workflow runs for head ==" gh api "repos/mouriya-devops/ci/actions/runs?head_sha=b8f5daa9de5aed194afd3b9685484ddbd1cf9f11" --jq ".workflow_runs[] | \"\(.name)\t\(.event)\t\(.status)\t\(.conclusion // \"-\")\""

cwd /private/tmp/ci16/ev17-head · /bin/sh · 2026-11-26T17:08:50.616Z – 2026-11-26T17:08:52.686Z · 工作区干净 · 记录 20261126T170850Z-73f4e0

stdout(共 8 行):

== head ==
b8f5daa9de5aed194afd3b9685484ddbd1cf9f11
== gh pr checks 21 ==
test	pass	16s	https://github.com/mouriya-devops/ci/actions/runs/45865122527/job/140065862087	
== check-runs for head ==
test	completed	success
== workflow runs for head ==
PR Check	pull_request	completed	success
结果 1 request · exit 0 · echo "head $(git rev-parse HEAD)" echo "== mise run check:pr ==" mise run check:pr echo "check:pr exit=$?" echo "== mise run check ==" mise run check echo "check exit=$?"

cwd /private/tmp/ci16/ev17-head · /bin/sh · 2026-11-26T17:09:51.925Z – 2026-11-26T17:09:53.584Z · 工作区干净 · 记录 20261126T170951Z-3f3a11

stdout(共 7 行):

head b8f5daa9de5aed194afd3b9685484ddbd1cf9f11
== mise run check:pr ==
bun test v1.4.4 (38afee6c8)
check:pr exit=0
== mise run check ==
bun test v1.4.4 (38afee6c8)
check exit=0

stderr(共 13 行):

[check:pr] $ actionlint && bun test selftest

 20 pass
 0 fail
 73 expect() calls
Ran 20 tests across 1 file. [495.00ms]
[check:pr] $ actionlint && bun test selftest

 20 pass
 0 fail
 73 expect() calls
Ran 20 tests across 1 file. [596.00ms]
Finished in 813.8ms
结果 1 log · exit 0 · echo "head $(git rev-parse HEAD)" base=$(mktemp -d /tmp/ci16/fx17.XXXXXX) for n in pinned nopersist paths coe noreject; do d=$base/$n git -c advice.detachedHead=false clone --local -q /tmp/ci16/ev17-head "$d" git -C "$d" apply /tmp/ci16/ev17-mutations/$n.patch echo "== $n ==" git -C "$d" diff -U0 | grep -E "^[-+][^-+]" ( cd "$d" && mise trust >/dev/null 2>&1 && mise run check:pr > "$base/$n.log" 2>&1; echo "[$n] exit=$?" ) grep -E "^\(fail\)" "$base/$n.log" done

cwd /private/tmp/ci16/ev17-head · /bin/sh · 2026-11-26T17:10:04.920Z – 2026-11-26T17:10:08.737Z · 工作区干净 · 记录 20261126T171004Z-499a2e

stdout(共 32 行):

head b8f5daa9de5aed194afd3b9685484ddbd1cf9f11
== pinned ==
-      - uses: actions/checkout@main
+      - uses: actions/checkout@v4
[pinned] exit=1
(fail) external action refs > every non-local uses tracks @main instead of a pinned version [0.43ms]
== nopersist ==
-        with:
-          persist-credentials: false
[nopersist] exit=1
(fail) actions/checkout > every checkout declares persist-credentials: false [0.18ms]
(fail) pr.yml > checks out without credentials and runs the check:pr task [0.07ms]
== paths ==
+    paths-ignore: ['**/*.md']
[paths] exit=1
(fail) pr.yml > triggers pull_request on main and tree/** plus merge_group [0.14ms]
(fail) pr.yml > carries no path filters or continue-on-error [0.04ms]
== coe ==
+        continue-on-error: true
[coe] exit=1
(fail) pr.yml > carries no path filters or continue-on-error [0.16ms]
== noreject ==
-          case "$EVENT_NAME" in
-            pull_request|pull_request_target)
-              if [ "$HEAD_REPO" != "$REPO" ] \
-                && jq -e 'any(.[]; ascii_downcase == "self-hosted")' <<<"$runs_on" >/dev/null; then
-                fail runs-on "pull request from '${HEAD_REPO:-<deleted repository>}' must not run on self-hosted runners of $REPO"
-              fi
-              ;;
-          esac
[noreject] exit=1
(fail) cross-repo pull request rejection > .github/workflows/check.yml rejects a fork pull request on self-hosted runners [14.65ms]
结果 3 before · exit 0 · echo "base $(git rev-parse HEAD)" echo "== .github/workflows at base ==" git ls-tree --name-only HEAD .github/workflows/ echo "== repo-settings declarations in base tree ==" git grep -n -E "allow_squash_merge|allow_merge_commit|allow_rebase_merge|delete_branch_on_merge" HEAD || echo "none"

cwd /private/tmp/ci16/ev17-base · /bin/sh · 2026-11-26T17:10:24.951Z – 2026-11-26T17:10:24.991Z · 工作区干净 · 记录 20261126T171024Z-e512c5

stdout(共 11 行):

base 7a922e847fb372c1dab8a086826d42cef773c91a
== .github/workflows at base ==
.github/workflows/check.yml
.github/workflows/image.yml
.github/workflows/release-artifact.yml
.github/workflows/self-check.yml
.github/workflows/selftest-check.yml
.github/workflows/selftest-image.yml
.github/workflows/selftest-release.yml
== repo-settings declarations in base tree ==
none
结果 3 request · exit 0 · echo "head $(git rev-parse HEAD)" gh api repos/mouriya-devops/ci --jq "{allow_squash_merge, allow_merge_commit, allow_rebase_merge, delete_branch_on_merge}"

cwd /private/tmp/ci16/ev17-head · /bin/sh · 2026-11-26T17:10:25.196Z – 2026-11-26T17:10:25.699Z · 工作区干净 · 记录 20261126T171025Z-aee1d2

stdout(共 2 行):

head b8f5daa9de5aed194afd3b9685484ddbd1cf9f11
{"allow_merge_commit":false,"allow_rebase_merge":false,"allow_squash_merge":true,"delete_branch_on_merge":true}
结果 3 log · exit 0 · echo "head $(git rev-parse HEAD)" gh repo view mouriya-devops/ci --json squashMergeAllowed,mergeCommitAllowed,rebaseMergeAllowed,deleteBranchOnMerge

cwd /private/tmp/ci16/ev17-head · /bin/sh · 2026-11-26T17:10:30.822Z – 2026-11-26T17:10:31.207Z · 工作区干净 · 记录 20261126T171030Z-f27e7b

stdout(共 2 行):

head b8f5daa9de5aed194afd3b9685484ddbd1cf9f11
{"deleteBranchOnMerge":true,"mergeCommitAllowed":false,"rebaseMergeAllowed":false,"squashMergeAllowed":true}
结果 2 request · exit 0 · echo "head $(git rev-parse HEAD)" echo "== pr.yml ==" nl -ba .github/workflows/pr.yml echo "== self-check.yml 3-5 ==" nl -ba .github/workflows/self-check.yml | sed -n "3,5p"

cwd /private/tmp/ci16/ev17-head · /bin/sh · 2026-11-26T17:10:49.759Z – 2026-11-26T17:10:49.791Z · 工作区干净 · 记录 20261126T171049Z-32a9d5

stdout(共 33 行):

head b8f5daa9de5aed194afd3b9685484ddbd1cf9f11
== pr.yml ==
     1	name: PR Check
     2	
     3	on:
     4	  pull_request:
     5	    branches: [main, 'tree/**']
     6	  merge_group:
     7	
     8	permissions:
     9	  contents: read
    10	
    11	concurrency:
    12	  group: pr-${{ github.event.pull_request.number || github.ref }}
    13	  cancel-in-progress: true
    14	
    15	jobs:
    16	  test:
    17	    name: test
    18	    runs-on: ubuntu-24.04
    19	    timeout-minutes: 10
    20	    steps:
    21	      - uses: actions/checkout@main
    22	        with:
    23	          persist-credentials: false
    24	
    25	      - uses: ./actions/mise-check
    26	        with:
    27	          task: check:pr
== self-check.yml 3-5 ==
     3	on:
     4	  push:
     5	    branches: [main, 'tree/**']

@RiriAgent

Copy link
Copy Markdown
Contributor Author

Gate 结论 · review · FAIL · HEAD b8f5daa · base tree/mouriya-devops-ci-16 · issue rev 2026-11-26T14:22:38Z · 设计 无

审查对象:证据包 #21 (comment) 与 PR 正文。结果 1 成立:mise run check:pr 与 mise run check 都 exit 0,五处违例都以 exit 1 被对应用例拒绝。结果 2、3 的 after 成立:b8f5daa 上只有 test success;仓库设置经 REST 与 GraphQL 读回一致。

缺陷:

  1. 结果 2 的 before(4d853c)只读了 workflow 配置,没有在 after 用的入口上重现旧 CheckRun 名(check / parse、check / check);改动前后用的不是同一入口。
  2. 结果 3 的 before(e512c5)没有任何旧状态读数。
  3. 正文「未验证与风险」第 1 条说 live test 尚未出现,与证据包矛盾;另外漏列了 merge_group 未真实执行。
  4. issue 现场第 24–34 行的 self-check.yml 写的是 push: branches: [main],而 base 的实际文件是不带分支过滤的 push 加 pull_request。

下一步:作者用 base 7a922e8 的 check-runs 重采结果 2 的 before;从仓库留下的痕迹给结果 3 补 before;更新正文。issue 现场的修正由 issue 作者处理。

@RiriAgent

Copy link
Copy Markdown
Contributor Author

证据包

由 ghc 生成 · issue #17 · 结果摘要 1cb67cacd1a2 · 3/3 条结果齐全 · 未观察的面 无 · 生成于 2026-11-26T17:31:07.935Z
检出 b8f5daa

结果 类型 面 步骤 状态 命令 记录
1 新 service request 已记录 echo "head $(git rev-parse HEAD)" echo "== mise run check:pr ==" mise run check:pr echo "check:pr exit=$?" echo "== mise run check ==" mise run check echo "check exit=$?" exit 0 · 1.7s
1 新 service log 已记录 echo "head $(git rev-parse HEAD)" base=$(mktemp -d /tmp/ci16/fx17.XXXXXX) for n in pinned nopersist paths coe noreject; do d=$base/$n git -c advice.detachedHead=false clone --local -q /tmp/ci16/ev17-head "$d" git -C "$d" apply /tmp/ci16/ev17-mutations/$n.patch echo "== $n ==" git -C "$d" diff -U0 | grep -E "^[-+][^-+]" ( cd "$d" && mise trust >/dev/null 2>&1 && mise run check:pr > "$base/$n.log" 2>&1; echo "[$n] exit=$?" ) grep -E "^\(fail\)" "$base/$n.log" done exit 0 · 3.8s
2 改 service before 已记录 echo "base $(git rev-parse HEAD)" gh api repos/mouriya-devops/ci/commits/7a922e847fb372c1dab8a086826d42cef773c91a/check-runs --jq "[.check_runs[]|{name,status,conclusion}]" gh api "repos/mouriya-devops/ci/actions/runs?head_sha=7a922e847fb372c1dab8a086826d42cef773c91a" --jq "[.workflow_runs[]|{name,event,conclusion}]" git ls-tree --name-only HEAD .github/workflows/ git show HEAD:.github/workflows/self-check.yml exit 0 · 0.9s
2 改 service request 已记录 echo "head $(git rev-parse HEAD)" echo "== pr.yml ==" nl -ba .github/workflows/pr.yml echo "== self-check.yml 3-5 ==" nl -ba .github/workflows/self-check.yml | sed -n "3,5p" exit 0 · 0.0s
2 改 service log 已记录 echo "head $(git rev-parse HEAD)" echo "== gh pr checks 21 ==" gh pr checks 21 -R mouriya-devops/ci echo "== check-runs for head ==" gh api repos/mouriya-devops/ci/commits/b8f5daa9de5aed194afd3b9685484ddbd1cf9f11/check-runs --jq ".check_runs[] | \"\(.name)\t\(.status)\t\(.conclusion // \"-\")\"" echo "== workflow runs for head ==" gh api "repos/mouriya-devops/ci/actions/runs?head_sha=b8f5daa9de5aed194afd3b9685484ddbd1cf9f11" --jq ".workflow_runs[] | \"\(.name)\t\(.event)\t\(.status)\t\(.conclusion // \"-\")\"" exit 0 · 1.9s
3 改 service before 已记录 echo "base $(git rev-parse HEAD)" gh api repos/mouriya-devops/ci/commits/7a922e847fb372c1dab8a086826d42cef773c91a --jq ".parents|length" gh pr view 20 -R mouriya-devops/ci --json mergedAt,mergeCommit,headRefName,state git ls-remote origin refs/heads/issue-19-mise-check git grep -n -E "allow_squash_merge|allow_merge_commit|allow_rebase_merge|delete_branch_on_merge" HEAD || echo "none in base tree" exit 0 · 1.3s
3 改 service request 已记录 echo "head $(git rev-parse HEAD)" gh api repos/mouriya-devops/ci --jq "{allow_squash_merge, allow_merge_commit, allow_rebase_merge, delete_branch_on_merge}" exit 0 · 0.5s
3 改 service log 已记录 echo "head $(git rev-parse HEAD)" gh repo view mouriya-devops/ci --json squashMergeAllowed,mergeCommitAllowed,rebaseMergeAllowed,deleteBranchOnMerge exit 0 · 0.4s

结果 1 · 新功能 · service

本仓新增确定性 workflow 策略自测并纳入 mise run check:pr 与 mise run check,扫描本仓全部 .github/workflows/*.yml 与 actions/**/*.yml,校验:外部 action 引用无版本钉死、所有 actions/checkout 显式声明 persist-credentials: false、pr.yml 不含 paths/paths-ignore 与 continue-on-error: true、自建池跨仓 PR 拒绝逻辑存在;人为制造任一违例时自测非零退出。

  • 改动后 · request(b8f5daa,记录 20261126T170951Z-3f3a11)看点:head b8f5daa 上 mise run check:pr 退出 0 并跑出 bun test 的 20 pass(含 workflow 策略自测);mise run check 先执行依赖 check:pr 再结束,退出 0,说明新自测同时接在两个入口上。
  • 改动后 · log(b8f5daa,记录 20261126T171004Z-499a2e)看点:五个 b8f5daa 的本地副本各注入一处违例(见每个 ==名称== 下的 -/+ 行:钉 @v4、去掉 persist-credentials、加 paths-ignore、加 continue-on-error、删掉 check.yml 的 fork PR 拒绝块),每处 mise run check:pr 都 exit=1,且 (fail) 行指名对应策略用例,说明自测对每类违例都非零退出。

结果 2 · 改功能(前后对比) · service

本仓 .github/workflows/pr.yml 在 pull_request 与 merge_group 上调用 actions/mise-check 产出唯一顶层 CheckRun test,旧 self-check.yml 不再在 PR 分支上重复触发 check / check。

  • 改动前 · before(7a922e8,记录 20261126T172933Z-c5d75a)看点:base 7a922e8 的 check-runs 只有两对 check / check 与 check / parse(均 success),没有顶层 test;该提交的 workflow runs 只有 self-check(push);工作流列表无 pr.yml,self-check.yml 第 4–5 行 on 含 pull_request 并以 workflow_call 调 check.yml —— 旧 PR 门禁产出 caller 前缀的 check / check。
  • 改动后 · request(b8f5daa,记录 20261126T171049Z-32a9d5)看点:pr.yml 第 3–6 行 on 只有 pull_request(branches: [main, tree/])与 merge_group;第 15–17 行 jobs 只有 test 且 name: test;第 25–27 行调用 ./actions/mise-check 且 task: check:pr,因此本仓 PR 只产出顶层 test;self-check.yml 第 3–5 行 on 只剩 push(branches: [main, tree/]),不再有 pull_request。
  • 改动后 · log(b8f5daa,记录 20261126T173013Z-722d38)看点:head b8f5daa 上 gh pr checks 只有顶层 test(pass,16s)与已发布的 evidence/ci:本仓接入 pr.yml 顶层 test 门禁、workflow 策略自测与 squash 合并设置 #17 状态行(3/3 条结果齐全 @b8f5daa),没有任何 workflow 产出的 check / check 或 check / parse;check-runs 只有一条 test completed success;该提交的 workflow runs 只有 PR Check 且 event 为 pull_request。

结果 3 · 改功能(前后对比) · service

本仓 GitHub 合并开关收敛为 allow_squash_merge: true、allow_merge_commit: false、allow_rebase_merge: false、delete_branch_on_merge: true。

  • 改动前 · before(7a922e8,记录 20261126T172933Z-1ec000)看点:base 时点 PR 新增顶层 test 门禁 composite action actions/mise-check 与 check.yml task 参数 #20 以两亲 merge commit 7a922e8 合入 main(parents=2、mergeCommit.oid=7a922e8),证明当时允许 merge commit;合并后 head 分支 issue-19-mise-check 仍在 origin(ls-remote 有值),证明当时未自动删分支;base 树无任何 allow_*/delete_branch_on_merge 声明。即旧开关 allow_merge_commit=true、delete_branch_on_merge=false;rebase 合并许可没有留下任何痕迹,无法从历史观察。
  • 改动后 · request(b8f5daa,记录 20261126T171025Z-aee1d2)看点:gh api 读回四项设置:allow_squash_merge=true、allow_merge_commit=false、allow_rebase_merge=false、delete_branch_on_merge=true;设置为 GitHub 侧状态,不在本 PR 的 diff 中,读数为采集时的实时值。
  • 改动后 · log(b8f5daa,记录 20261126T171030Z-f27e7b)看点:gh repo view(GraphQL)独立读回四字段:squashMergeAllowed=true、mergeCommitAllowed=false、rebaseMergeAllowed=false、deleteBranchOnMerge=true,与 REST 读回一致,只剩 squash 且合入后自动删分支。
结果 1 request · exit 0 · echo "head $(git rev-parse HEAD)" echo "== mise run check:pr ==" mise run check:pr echo "check:pr exit=$?" echo "== mise run check ==" mise run check echo "check exit=$?"

cwd /private/tmp/ci16/ev17-head · /bin/sh · 2026-11-26T17:09:51.925Z – 2026-11-26T17:09:53.584Z · 工作区干净 · 记录 20261126T170951Z-3f3a11

stdout(共 7 行):

head b8f5daa9de5aed194afd3b9685484ddbd1cf9f11
== mise run check:pr ==
bun test v1.4.4 (38afee6c8)
check:pr exit=0
== mise run check ==
bun test v1.4.4 (38afee6c8)
check exit=0

stderr(共 13 行):

[check:pr] $ actionlint && bun test selftest

 20 pass
 0 fail
 73 expect() calls
Ran 20 tests across 1 file. [495.00ms]
[check:pr] $ actionlint && bun test selftest

 20 pass
 0 fail
 73 expect() calls
Ran 20 tests across 1 file. [596.00ms]
Finished in 813.8ms
结果 1 log · exit 0 · echo "head $(git rev-parse HEAD)" base=$(mktemp -d /tmp/ci16/fx17.XXXXXX) for n in pinned nopersist paths coe noreject; do d=$base/$n git -c advice.detachedHead=false clone --local -q /tmp/ci16/ev17-head "$d" git -C "$d" apply /tmp/ci16/ev17-mutations/$n.patch echo "== $n ==" git -C "$d" diff -U0 | grep -E "^[-+][^-+]" ( cd "$d" && mise trust >/dev/null 2>&1 && mise run check:pr > "$base/$n.log" 2>&1; echo "[$n] exit=$?" ) grep -E "^\(fail\)" "$base/$n.log" done

cwd /private/tmp/ci16/ev17-head · /bin/sh · 2026-11-26T17:10:04.920Z – 2026-11-26T17:10:08.737Z · 工作区干净 · 记录 20261126T171004Z-499a2e

stdout(共 32 行):

head b8f5daa9de5aed194afd3b9685484ddbd1cf9f11
== pinned ==
-      - uses: actions/checkout@main
+      - uses: actions/checkout@v4
[pinned] exit=1
(fail) external action refs > every non-local uses tracks @main instead of a pinned version [0.43ms]
== nopersist ==
-        with:
-          persist-credentials: false
[nopersist] exit=1
(fail) actions/checkout > every checkout declares persist-credentials: false [0.18ms]
(fail) pr.yml > checks out without credentials and runs the check:pr task [0.07ms]
== paths ==
+    paths-ignore: ['**/*.md']
[paths] exit=1
(fail) pr.yml > triggers pull_request on main and tree/** plus merge_group [0.14ms]
(fail) pr.yml > carries no path filters or continue-on-error [0.04ms]
== coe ==
+        continue-on-error: true
[coe] exit=1
(fail) pr.yml > carries no path filters or continue-on-error [0.16ms]
== noreject ==
-          case "$EVENT_NAME" in
-            pull_request|pull_request_target)
-              if [ "$HEAD_REPO" != "$REPO" ] \
-                && jq -e 'any(.[]; ascii_downcase == "self-hosted")' <<<"$runs_on" >/dev/null; then
-                fail runs-on "pull request from '${HEAD_REPO:-<deleted repository>}' must not run on self-hosted runners of $REPO"
-              fi
-              ;;
-          esac
[noreject] exit=1
(fail) cross-repo pull request rejection > .github/workflows/check.yml rejects a fork pull request on self-hosted runners [14.65ms]
结果 3 request · exit 0 · echo "head $(git rev-parse HEAD)" gh api repos/mouriya-devops/ci --jq "{allow_squash_merge, allow_merge_commit, allow_rebase_merge, delete_branch_on_merge}"

cwd /private/tmp/ci16/ev17-head · /bin/sh · 2026-11-26T17:10:25.196Z – 2026-11-26T17:10:25.699Z · 工作区干净 · 记录 20261126T171025Z-aee1d2

stdout(共 2 行):

head b8f5daa9de5aed194afd3b9685484ddbd1cf9f11
{"allow_merge_commit":false,"allow_rebase_merge":false,"allow_squash_merge":true,"delete_branch_on_merge":true}
结果 3 log · exit 0 · echo "head $(git rev-parse HEAD)" gh repo view mouriya-devops/ci --json squashMergeAllowed,mergeCommitAllowed,rebaseMergeAllowed,deleteBranchOnMerge

cwd /private/tmp/ci16/ev17-head · /bin/sh · 2026-11-26T17:10:30.822Z – 2026-11-26T17:10:31.207Z · 工作区干净 · 记录 20261126T171030Z-f27e7b

stdout(共 2 行):

head b8f5daa9de5aed194afd3b9685484ddbd1cf9f11
{"deleteBranchOnMerge":true,"mergeCommitAllowed":false,"rebaseMergeAllowed":false,"squashMergeAllowed":true}
结果 2 request · exit 0 · echo "head $(git rev-parse HEAD)" echo "== pr.yml ==" nl -ba .github/workflows/pr.yml echo "== self-check.yml 3-5 ==" nl -ba .github/workflows/self-check.yml | sed -n "3,5p"

cwd /private/tmp/ci16/ev17-head · /bin/sh · 2026-11-26T17:10:49.759Z – 2026-11-26T17:10:49.791Z · 工作区干净 · 记录 20261126T171049Z-32a9d5

stdout(共 33 行):

head b8f5daa9de5aed194afd3b9685484ddbd1cf9f11
== pr.yml ==
     1	name: PR Check
     2	
     3	on:
     4	  pull_request:
     5	    branches: [main, 'tree/**']
     6	  merge_group:
     7	
     8	permissions:
     9	  contents: read
    10	
    11	concurrency:
    12	  group: pr-${{ github.event.pull_request.number || github.ref }}
    13	  cancel-in-progress: true
    14	
    15	jobs:
    16	  test:
    17	    name: test
    18	    runs-on: ubuntu-24.04
    19	    timeout-minutes: 10
    20	    steps:
    21	      - uses: actions/checkout@main
    22	        with:
    23	          persist-credentials: false
    24	
    25	      - uses: ./actions/mise-check
    26	        with:
    27	          task: check:pr
== self-check.yml 3-5 ==
     3	on:
     4	  push:
     5	    branches: [main, 'tree/**']
结果 3 before · exit 0 · echo "base $(git rev-parse HEAD)" gh api repos/mouriya-devops/ci/commits/7a922e847fb372c1dab8a086826d42cef773c91a --jq ".parents|length" gh pr view 20 -R mouriya-devops/ci --json mergedAt,mergeCommit,headRefName,state git ls-remote origin refs/heads/issue-19-mise-check git grep -n -E "allow_squash_merge|allow_merge_commit|allow_rebase_merge|delete_branch_on_merge" HEAD || echo "none in base tree"

cwd /private/tmp/ci16/ev17-base · /bin/sh · 2026-11-26T17:29:33.551Z – 2026-11-26T17:29:34.814Z · 工作区干净 · 记录 20261126T172933Z-1ec000

stdout(共 5 行):

base 7a922e847fb372c1dab8a086826d42cef773c91a
2
{"headRefName":"issue-19-mise-check","mergeCommit":{"oid":"7a922e847fb372c1dab8a086826d42cef773c91a"},"mergedAt":"2026-11-26T16:09:24Z","state":"MERGED"}
4a5050618f0d296b0077c61d49a69ed23ae4f3a7	refs/heads/issue-19-mise-check
none in base tree
结果 2 before · exit 0 · echo "base $(git rev-parse HEAD)" gh api repos/mouriya-devops/ci/commits/7a922e847fb372c1dab8a086826d42cef773c91a/check-runs --jq "[.check_runs[]|{name,status,conclusion}]" gh api "repos/mouriya-devops/ci/actions/runs?head_sha=7a922e847fb372c1dab8a086826d42cef773c91a" --jq "[.workflow_runs[]|{name,event,conclusion}]" git ls-tree --name-only HEAD .github/workflows/ git show HEAD:.github/workflows/self-check.yml

cwd /private/tmp/ci16/ev17-base · /bin/sh · 2026-11-26T17:29:33.757Z – 2026-11-26T17:29:34.661Z · 工作区干净 · 记录 20261126T172933Z-c5d75a

stdout(共 22 行):

base 7a922e847fb372c1dab8a086826d42cef773c91a
[{"conclusion":"success","name":"check / check","status":"completed"},{"conclusion":"success","name":"check / parse","status":"completed"},{"conclusion":"success","name":"check / check","status":"completed"},{"conclusion":"success","name":"check / parse","status":"completed"}]
[{"conclusion":"success","event":"push","name":"self-check"},{"conclusion":"success","event":"push","name":"self-check"}]
.github/workflows/check.yml
.github/workflows/image.yml
.github/workflows/release-artifact.yml
.github/workflows/self-check.yml
.github/workflows/selftest-check.yml
.github/workflows/selftest-image.yml
.github/workflows/selftest-release.yml
name: self-check

on:
  push:
  pull_request:

permissions:
  contents: read

jobs:
  check:
    uses: ./.github/workflows/check.yml
结果 2 log · exit 0 · echo "head $(git rev-parse HEAD)" echo "== gh pr checks 21 ==" gh pr checks 21 -R mouriya-devops/ci echo "== check-runs for head ==" gh api repos/mouriya-devops/ci/commits/b8f5daa9de5aed194afd3b9685484ddbd1cf9f11/check-runs --jq ".check_runs[] | \"\(.name)\t\(.status)\t\(.conclusion // \"-\")\"" echo "== workflow runs for head ==" gh api "repos/mouriya-devops/ci/actions/runs?head_sha=b8f5daa9de5aed194afd3b9685484ddbd1cf9f11" --jq ".workflow_runs[] | \"\(.name)\t\(.event)\t\(.status)\t\(.conclusion // \"-\")\""

cwd /private/tmp/ci16/ev17-head · /bin/sh · 2026-11-26T17:30:13.376Z – 2026-11-26T17:30:15.293Z · 工作区干净 · 记录 20261126T173013Z-722d38

stdout(共 8 行):

head b8f5daa9de5aed194afd3b9685484ddbd1cf9f11
== gh pr checks 21 ==
evidence/mouriya-devops/ci#17	pass	0	https://github.com/mouriya-devops/ci/pull/21#issuecomment-7198641627	3/3 条结果齐全 @b8f5daa
test	pass	16s	https://github.com/mouriya-devops/ci/actions/runs/45865122527/job/140065862087	
== check-runs for head ==
test	completed	success
== workflow runs for head ==
PR Check	pull_request	completed	success

@RiriAgent

Copy link
Copy Markdown
Contributor Author

重试意图

处理 #21 (comment) 的 FAIL,续用原分支,HEAD 仍为 b8f5daa。

实现变化

无。

证据与正文

  • 结果 2 的 before(c5d75a)与 after 用同一入口:base 7a922e8 的 check-runs 是两组 check / check 加 check / parse,workflow runs 是两次 self-check push,没有 pr.yml、没有顶层 test。新的 live 读数(722d38)显示 b8f5daa 上 check-runs 只有 test success,workflow runs 只有 PR Check 的 pull_request。
  • 结果 3 的 before(1ec000)来自仓库在 base 时留下的痕迹:7a922e8 是 PR 新增顶层 test 门禁 composite action actions/mise-check 与 check.yml task 参数 #20 的合并提交,有两个父提交,说明当时允许合并提交;PR 新增顶层 test 门禁 composite action actions/mise-check 与 check.yml task 参数 #20 合并后 head 分支 issue-19-mise-check 仍在远端,说明当时没有开启合并后删分支。rebase 合并的开关没有留下痕迹,记录里没有声称它。
  • 正文「未验证与风险」:删去过时的「live test 尚未出现」,补上 merge_group 未真实执行(仓库没有 merge queue)。
  • issue 现场第 24–34 行与 base 不符,已报告给 issue 作者修正。

新证据包:#21 (comment)

@RiriAgent

Copy link
Copy Markdown
Contributor Author

Gate 结论 · review · PASS · HEAD b8f5daa · base tree/mouriya-devops-ci-16 · issue rev 2026-11-26T14:22:38Z · 设计 无

增量复审,证据包 #21 (comment) 。

  • 结果 2:before c5d75a 与 after 722d38 读的是同一组 check-runs/workflow runs。base 上有 check / check 与 check / parse,没有顶层 test;head 上只有顶层 test,PR Check 只由 pull_request 触发。
  • 结果 3:before 1ec000 用 7a922e8 是两个父提交的合并提交、以及合并后仍留在远端的 issue-19-mise-check 分支,证明当时 allow_merge_commit 为 true、delete_branch_on_merge 为 false;rebase 开关没有痕迹,看点已写明。
  • 正文「未验证与风险」已更新:live test 已运行,merge_group 未真实执行。

非阻塞:issue 现场的 self-check.yml 片段仍待 issue 侧修正,正文与证据都不依赖它;722d38 中的 evidence status 行指向旧包。

@RiriAgent
RiriAgent merged commit 3845f38 into tree/mouriya-devops-ci-16 Nov 26, 2026
2 checks passed
@RiriAgent
RiriAgent deleted the issue-17-pr-test branch November 26, 2026 17:37
RiriAgent added a commit that referenced this pull request Nov 28, 2026
* Add a PR gate and an offline workflow policy self-test

- Add .github/workflows/pr.yml: pull_request on main and tree/** plus merge_group, one hosted job named test running ./actions/mise-check with task check:pr
- Restrict self-check.yml to push on main and tree/** so pull requests no longer produce check / check
- Add selftest/workflows/policy.test.ts: offline bun test over .github/workflows/*.yml and actions/**/*.yml for unpinned external refs, persist-credentials: false, pr.yml path filters and continue-on-error, and the cross-repo self-hosted rejection
- Add mise task check:pr and run the policy self-test from check, which keeps actionlint
- Refs #17

* selftest: run the fork-PR rejection for real and lint workflows in check:pr

- policy test executes the parse scripts of check.yml, image.yml and release-artifact.yml and guard.sh under fork and same-repo/hosted inputs; workflows with caller-controlled runs-on must be probed
- check:pr runs actionlint (with shellcheck) before the policy test; check depends on check:pr

Refs #17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant