Skip to content

[WP12] CI/CD supply-chain & gating: unpinned actions, auto-merge without in-repo build gate, dead branch guard #197

Open

Description

@shihyuho

此內容由 AI 產生(specification-mapper 全庫審查 2026-07-16.執行圖)。

Work package WP12 · findings: DEP-02, TEST-01, COR-02 · worst severity: medium · effort: S

From the 2026-07-16 whole-codebase review of branch jakarta (snapshot 7de4a33; modules mapper/ + starter/). Every finding below is CONFIRMED by independent adversarial verification. File:line coordinates are from the snapshot and may have drifted.

Findings

DEP-02 — Third-party actions pinned to mutable tags in a workflow wielding a repo-write token that auto-merges its own PRs (dependencies, medium)

  • File: .github/workflows/bump-spring.yml:42
  • Evidence: madhead/semver-utils@latest (and other third-party actions on mutable tags) run in a workflow that holds a repo-write App token and auto-merges the PRs it creates — a compromised tag is a supply-chain write path into the repo.

TEST-01 — Dependency-bump PRs auto-merge while the only in-repo PR-triggered check is commitlint (testing, medium)

  • File: .github/workflows/bump-spring.yml:91
  • Evidence: build/test gating for auto-merged bump PRs depends entirely on out-of-repo Jenkins branch protection.

COR-02 — Jenkins failure notification gated on BRANCH_NAME == 'main', never true on the active jakarta branch (correctness, medium)

  • File: Jenkinsfile:157
  • Failure scenario: build failures on the active line never notify anyone.

Plan

  1. SHA-pin every third-party action in the workflows (full commit SHA with a version comment), including madhead/semver-utils (DEP-02).
  2. Add an in-repo PR-triggered build gate: a GitHub Actions workflow running mvn verify on pull requests, so auto-merge has an in-repo status to require (TEST-01). Note for the maintainer: mark the new check required in branch protection (settings change is outside this PR's scope).
  3. Fix the Jenkinsfile notification guard to the active primary branch (jakarta, or parameterize on the repository default branch) so failures alert again (COR-02).

Acceptance criteria

  • No third-party action remains on a mutable tag.
  • A bump PR gets an in-repo build/test status before merge.
  • A failing build on jakarta produces the notification.
  • Regression: workflows pass on a test PR; make test green.

Activity

  1. added theissue type on Jul 20, 2026
  2. added
    github_actionsPull requests that update GitHub Actions code
    status: ready-for-agentFully specified and ready for an autonomous AFK agent to implement
    on Jul 20, 2026
  3. shihyuho commented on Jul 20, 2026

    @shihyuho
    MemberAuthor

    範圍決定:僅處理 COR-02

    本工作包經評估後縮小範圍,三項發現的處置如下:

    發現 決定 說明
    COR-02 Jenkins 通知守衛失效 ✅ 處理中 抽出為 #212。純 bug fix,與另兩項無關
    TEST-01 auto-merge 缺 in-repo build gate ❌ 不做 既有 Jenkins 已負責 build gating,再加 GitHub Actions job 等於同一份測試跑兩次
    DEP-02 第三方 action 釘選可變 tag ❌ 不做 維護成本相對於本 repo 的風險輪廓不划算

    原 PR #206 已關閉,實作細節與驗證記錄保留在該 PR 供日後參考(若之後改變心意,SHA 對照表可直接取用)。

    殘留風險(明知並接受):bump-spring.yml 持有 repo 寫入權、會自動 merge 自己開的 PR,其把關仍完全依賴 repo 外的 Jenkins 與 branch protection 設定。

    另記一項本包過程中發現、原審查未涵蓋的問題:WyriHaximus/github-action-next-semvers@v1 是停滯的 major alias,指向 2020 年的 commit,落後 v1.2.1 約 63 個 commit。與 SHA 釘選的取捨無關,值得單獨評估。

    待 #212 合併後即可關閉本議題。

  4. removed
    status: ready-for-agentFully specified and ready for an autonomous AFK agent to implement
    on Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

github_actionsPull requests that update GitHub Actions codetype: enhancementNew feature or request

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions