Skip to content

chore(security): pin actions and configure Dependabot - #2212

Merged
Astro-Han merged 1 commit into
apache:mainfrom
Colafornia:security/pin-actions-dependabot
Aug 5, 2026
Merged

Astro-Han merged 1 commit into
apache:mainfrom
Colafornia:security/pin-actions-dependabot

Conversation

@Colafornia

@Colafornia Colafornia commented Aug 5, 2026 •

Copy link
Copy Markdown
Member
English

Summary

  • pin all 41 external GitHub Action references across five workflows to verified immutable commit SHAs
  • retain exact release versions as inline comments so Dependabot can maintain the pinned references
  • configure weekly Dependabot updates for the root npm workspace and GitHub Actions
  • group npm minor and patch updates while keeping major updates separate
  • align the existing Windows baseline workflow contract test with immutable Action references

Pinned Actions

Action Release Commit SHA
actions/checkout v4.4.0 11d5960a326750d5838078e36cf38b85af677262
actions/setup-node v4.4.0 49933ea5288caeca8642d1e84afbd3f7d6820020
actions/upload-artifact v4.6.2 ea165f8d65b6e75b540449e92b4886f43607fa02
actions/download-artifact v4.3.0 d3f86a106a0bac45b974a628896c90dbdf5c8093
astral-sh/setup-uv v6.8.0 d0cc045d04ccac9d8b7881df0226f9e82c39688e
docker/setup-buildx-action v3.12.0 8d2750c68a42422c14e847fe6c8ac0403b4cbd6f

Each SHA was resolved from the corresponding official stable release tag. All Actions stay within their existing major version.

Security boundary

Workflow triggers, jobs, steps, permissions, inputs, and execution logic are unchanged. Dependabot is limited to weekly npm and GitHub Actions updates with open-pull-requests-limit: 10; npm minor and patch updates share one group, while major updates remain independent. This PR does not add auto-merge, automatic approval, audit workflows, CodeQL, advisory remediation, application changes, or new dependencies.

Verification

  • actionlint .github/workflows/*.yml — passed
  • npm run test:scripts — 115 passed
  • all changed YAML parsed successfully; Dependabot ecosystem, directory, schedule, grouping, and limit semantics checked
  • 41/41 external uses: references use full 40-character SHAs with exact version comments; no tag-only references remain
  • all six SHA/version mappings verified against official GitHub release tags through the GitHub API
  • independent glm-5.2:cloud configuration review — no findings
  • git diff --check origin/main...HEAD — passed
  • full application tests not run; changes are limited to GitHub configuration and its workflow contract test
简体中文

摘要

  • 将 5 个 workflow 中全部 41 条外部 GitHub Action 引用固定到经过验证的不可变 commit SHA
  • 使用行内注释保留准确 release 版本,使 Dependabot 能持续维护 pinned 引用
  • 为根 npm workspace 和 GitHub Actions 配置每周 Dependabot 更新
  • 将 npm minor 与 patch 更新分组,major 更新保持独立
  • 同步现有 Windows baseline workflow 契约测试,使其验证不可变 Action 引用

固定的 Actions

Action Release Commit SHA
actions/checkout v4.4.0 11d5960a326750d5838078e36cf38b85af677262
actions/setup-node v4.4.0 49933ea5288caeca8642d1e84afbd3f7d6820020
actions/upload-artifact v4.6.2 ea165f8d65b6e75b540449e92b4886f43607fa02
actions/download-artifact v4.3.0 d3f86a106a0bac45b974a628896c90dbdf5c8093
astral-sh/setup-uv v6.8.0 d0cc045d04ccac9d8b7881df0226f9e82c39688e
docker/setup-buildx-action v3.12.0 8d2750c68a42422c14e847fe6c8ac0403b4cbd6f

每个 SHA 都由对应 Action 的官方稳定 release tag 解析得到。所有 Action 都保持在原有 major 版本内。

安全边界

Workflow 的触发条件、job、step、权限、input 和执行逻辑均未改变。Dependabot 仅每周维护 npm 与 GitHub Actions,两个 ecosystem 的 open-pull-requests-limit 均为 10;npm minor 与 patch 更新使用同一分组,major 更新保持独立。本 PR 不添加 auto-merge、自动审批、依赖审计 workflow、CodeQL、advisory 修复、应用修改或新依赖。

验证

  • actionlint .github/workflows/*.yml — 通过
  • npm run test:scripts — 115 项通过
  • 所有变更 YAML 均成功解析,并核对 Dependabot ecosystem、目录、schedule、分组和 limit 语义
  • 41/41 条外部 uses: 引用均使用完整 40 字符 SHA 和准确版本注释,不存在剩余 tag-only 引用
  • 通过 GitHub API 对照官方 release tag 验证全部 6 组 SHA/版本映射
  • 独立 glm-5.2:cloud 配置 review — 无 findings
  • git diff --check origin/main...HEAD — 通过
  • 变更仅限 GitHub 配置及其 workflow 契约测试,因此未运行完整应用测试

Part of #2207

Pin third-party CI code to immutable SHAs and let Dependabot keep Actions and root npm dependencies current.\n\nRefs apache#2207
@Colafornia
Colafornia force-pushed the security/pin-actions-dependabot branch from 7b1750d to 68bea5f Compare August 5, 2026 07:03
@Astro-Han

Copy link
Copy Markdown
Contributor

Thanks for this — I verified it end to end and the work is solid: all 41 uses: references are full immutable 40-char SHAs with version comments (100% conversion, zero tag-only refs), all six SHA↔release mappings check out live against the official tags via the GitHub API (and the tags are lightweight commits, so the pins are truly immutable), actionlint is clean on all five workflows, and the diff touches nothing but uses: lines, the new config, and one test regex — no hidden trigger/permission changes. The Windows baseline contract test is actually strengthened (a revert to @v4 now fails it). The design is the minimal correct one for this repo: SHA-pin + Dependabot + version comments is GitHub's own hardening pattern, Dependabot-only would leave the supply-chain risk open, SHA-only would rot, and Renovate would be a heavier tool for no gain. Grouping and limits are the documented-recommended shape.

One optional nitpick:

P3 — scripts/windows-baseline-workflow.test.mjs:57 hardcodes the major version (/actions\/upload-artifact@[0-9a-f]{40} # v4\.\d+\.\d+/u), so the first Dependabot major bump (upload-artifact v5) fails test:scripts and needs a manual regex edit inside that PR. # v\d+\.\d+\.\d+ generalizes it with no loss of intent.

Merging — nice supply-chain hygiene.

@Astro-Han
Astro-Han merged commit 82ccc47 into apache:main Aug 5, 2026
13 checks passed
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.

2 participants