Skip to content

fix(ci): harden GitHub Actions workflows (#1179) - #1184

Merged
burtenshaw merged 1 commit into
ben/rfc008-l2-02-dockerfrom
security/workflow-hardening/pr-1179
Sep 16, 2026
Merged

burtenshaw merged 1 commit into
ben/rfc008-l2-02-dockerfrom
security/workflow-hardening/pr-1179

Conversation

@hf-security-analysis

@hf-security-analysis hf-security-analysis Bot commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Automated hardening of the workflow files flagged on #1179.

Targets ben/rfc008-l2-02-docker. Files changed:

  • .github/workflows/validation-runtime.yml

Fixed by this PR:

  • HIGH unpinned-action (pinact) — .github/workflows/validation-runtime.yml:18
  • HIGH unpinned-action (pinact) — .github/workflows/validation-runtime.yml:22
  • HIGH unpinned-action (pinact) — .github/workflows/validation-runtime.yml:25
  • HIGH unpinned-action (pinact) — .github/workflows/validation-runtime.yml:45

Pinning changes come from pinact and are mechanical. Any other change was generated by Claude — read it before merging.


Note

Low Risk
Mechanical supply-chain hardening only; no changes to validation logic or secrets handling.

Overview
Pins four third-party GitHub Actions in Validation runtime to immutable commit SHAs (with version comments) instead of floating @v7 / @v4 tags: actions/checkout, actions/setup-python, astral-sh/setup-uv, and actions/upload-artifact.

This addresses unpinned-action findings from workflow hardening (#1179); job steps, Python/uv versions, and validation commands are unchanged.

Reviewed by Cursor Bugbot for commit ec3754e. Bugbot is set up for automated code reviews on this repo. Configure here.

@burtenshaw burtenshaw added enhancement New feature or request size: small Small pull request labels Sep 16, 2026 — with Cursor
@bot-ci-comment

Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alignment Review Report

Supply-chain hardening: validation-runtime.yml moves four actions from floating major tags to full commit-SHA pins (each annotated # vX.Y.Z). The substance of this PR is whether every pin authentically matches its claimed tag — it does.

Automated Checks

  • Lint: N/A (PASS) — YAML-only diff; the Python-only lint.sh hook doesn't lint .github/workflows/. (uv isn't installed on this review VM, so the hook no-ops immediately — unrelated to this PR.)
  • Debug code: CLEAN — check-debug.sh scans src/ only; the pre-existing push.py console.print / CLI TODO hits are not in this diff.
  • YAML validity: PASS — validation-runtime.yml parses.
  • SHA authenticity (verified against upstream via GitHub API — each SHA dereferences to the exact tag in its comment):
Action Pinned SHA Comment Verified
actions/checkout 3d3c42e5…ba90b1 v7.0.1 ✓ v7.0.1
actions/setup-python 5fda3b95…53e4b97 v7.0.0 ✓ v7.0.0
astral-sh/setup-uv 37802adc…1f3b78 v7.6.0 ✓ v7.6.0
actions/upload-artifact ea165f8d…07fa02 v4.6.2 ✓ v4.6.2

All are full 40-char pins, and each is the latest patch within the same major that was previously floating (@v7/@v7/@v7/@v4) → zero behavioral change, pure supply-chain hardening. The pins are byte-identical to the already-hardened sibling discovery-catalog.yml in this stack, so they're deliberate and consistent.

Open RFCs Context

validation-runtime.yml belongs to the RFC-008 (Environment Auto-Validation, In Review, @zkwentz) Level-2 Docker validation stack (base ben/rfc008-l2-02-docker); the repo also carries RFC-011 (ARD Catalog Discovery, Draft), whose sibling discovery-catalog.yml uses the same pins. No RFC governs CI / GitHub Actions, so this change neither touches nor pre-empts any RFC design surface.

Tier 1: Fixes Required

None. SHAs authentic, comments accurate, majors preserved (no breaking bump), YAML valid.

Tier 2: Alignment Discussion

Principle Conflicts

None identified. Security-positive (SHA pinning mitigates mutable-tag supply-chain risk). permissions: contents: read, persist-credentials: false, and on: pull_request (not pull_request_target) are already in place; no runtime API surface (Gym/MCP/rewards/client-server/container/credentials) is touched.

RFC Conflicts

None identified.

Summary

  • 0 mechanical issues to fix
  • 0 alignment points for human review
  • 0 RFC conflicts

Non-blocking FYIs (reviewer @burtenshaw — owns .github/ + dependabot and authored the base stack; cc @zkwentz for RFC-008):

  • Scope: the title says "workflows" (plural) but only validation-runtime.yml changed. That's correct for this stack — it now matches the already-pinned discovery-catalog.yml. The rest of the repo (test.yml, package-ci.yml, deploy-hf-env.yml, docker-build.yml, publish-*.yml, manage-hf-collection.yml, openspiel_base_build.yml) still uses floating tags, a natural repo-wide follow-up.
  • Maintenance: the github-actions Dependabot updater supports SHA pins and keeps the # vX.Y.Z comment fresh, so these won't silently go stale.
  • Minor (pre-existing, out of scope): upload-artifact is pinned to the v4 major here vs. the v7 major in publish-*.yml — a repo-internal inconsistency a future unification pass could resolve.
Open in Web View Automation 

Sent by Cursor Automation: Pre-review

timeout-minutes: 30
steps:
- uses: actions/checkout@v7
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✓ Verified authentic: 3d3c42e5aac5ba805825da76410c181273ba90b1 is the commit for actions/checkout tag v7.0.1 (latest v7; confirmed via GitHub API). Full 40-char pin, same major as the prior @v7 → no behavior change. persist-credentials: false is retained. 👍

persist-credentials: false
ref: ${{ github.event.pull_request.head.sha || github.sha }}
- uses: actions/setup-python@v7
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✓ Verified authentic: 5fda3b95a4ea91299a34e894583c3862153e4b97 = actions/setup-python v7.0.0 (latest v7). Matches the prior @v7 major → no behavior change.

with:
python-version: "3.12.13"
- uses: astral-sh/setup-uv@v7
- uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✓ Verified authentic: 37802adc94f370d6bfd71619e3f0bf239e1f3b78 = astral-sh/setup-uv v7.6.0. Keeps the @v7 major used elsewhere (test.yml) and is byte-identical to the sibling discovery-catalog.yml pin. (setup-uv's latest overall is v10, but staying on v7 preserves parity + behavior — good call for a hardening-only PR; leave the major bump to Dependabot.)

- name: Retain evidence on success or failure
if: always()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✓ Verified authentic: ea165f8d65b6e75b540449e92b4886f43607fa02 = actions/upload-artifact v4.6.2 (latest v4). Same v4 major as before. Note (pre-existing, out of scope): publish-*.yml pin the v7 major of this action — a repo-internal inconsistency for a future unification pass.

@burtenshaw
burtenshaw merged commit f56bc0c into ben/rfc008-l2-02-docker Sep 16, 2026
5 checks passed
burtenshaw pushed a commit that referenced this pull request Sep 22, 2026
Co-authored-by: hf-security-analysis[bot] <265538906+hf-security-analysis[bot]@users.noreply.github.com>
burtenshaw added a commit that referenced this pull request Sep 22, 2026
* Add Docker validation provider and reproducible lab

* Keep validation cleanup independent of image metadata

* fix(ci): harden workflow files flagged on #1179 (#1184)

Co-authored-by: hf-security-analysis[bot] <265538906+hf-security-analysis[bot]@users.noreply.github.com>

* Refresh validation lab metadata for current OpenEnv

* fix: retain complete validation evidence

* fix: preserve source files and exact diff hashes

* fix: address docker lab review

* fix: scope pip regression to validation lab

* fix: exclude known credential files

* fix: align credential snapshot filtering

* fix: separate Docker probe stderr

* fix: isolate command stdout

---------

Co-authored-by: hf-security-analysis[bot] <265538906+hf-security-analysis[bot]@users.noreply.github.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size: small Small pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant