Skip to content

ci: harden validation workflows - #113

Merged
carolinerg1 merged 2 commits into
Universal-Commerce-Protocol:mainfrom
FanouZeng-TT:ci/harden-workflows
Nov 6, 2026
Merged

carolinerg1 merged 2 commits into
Universal-Commerce-Protocol:mainfrom
FanouZeng-TT:ci/harden-workflows

Conversation

@FanouZeng-TT

Copy link
Copy Markdown
Contributor

Description

Four conformance workflows run third-party Actions by mutable tag, or inherit token permissions they do not need:

  • linter.yaml — actions/checkout@v5 and super-linter/super-linter/slim@v8, with a checkout that keeps its credentials.
  • pre-commit.yml — actions/checkout@v5, actions/setup-python@v6, pre-commit/action@v3.0.1, and no explicit workflow permissions, so the job inherits the repository default token.
  • spellcheck.yaml — actions/checkout@v5 and streetsidesoftware/cspell-action@v8, with a read-only checkout that keeps its credentials.
  • pr-review-listener.yml — only echoes the review event's PR number, but inherits the repository's default token permissions.

A mutable tag can be retargeted at any time, so a retagged or compromised upstream release would run here unreviewed. The read-only jobs never push, so their checkouts do not need persisted credentials, and a pure logging job needs no token at all.

Fix: harden these four workflows together: pin every referenced Action to its current tag's full commit SHA, add permissions: contents: read to the pre-commit job, disable credential persistence on the read-only checkouts, and give the pure signal job permissions: {}. linter.yaml keeps its packages/statuses permissions and spellcheck.yaml keeps its job-level contents/actions reads, both unchanged; triggers and job commands are untouched. conformance-tests.yml is already pinned and is excluded because open PR #107 modifies it.

Category (Required)

  • Core Protocol: Protocol specification changes. (Requires Technical Council approval)
  • Governance/Contributing: Governance or contribution process changes. (Requires Governance Council approval)
  • Capability: Capability specification changes. (Requires Maintainer approval)
  • Documentation: Documentation updates. (Requires Maintainer approval)
  • Infrastructure: Build, CI, tooling, or release changes. (Requires DevOps Maintainer approval)
  • Maintenance: Dependency, compatibility, or routine maintenance changes. (Requires DevOps Maintainer approval)
  • SDK: Language-specific SDK updates and releases. (Requires DevOps Maintainer approval)
  • Samples / Conformance: Maintaining samples and the conformance suite. (Requires Maintainer approval)
  • UCP Schema: Changes to the ucp-schema tool. (Requires Maintainer approval)
  • Community Health (.github): Repository-wide health files and configuration. (Requires DevOps Maintainer approval)

Related Issues

N/A

Checklist

  • I have followed the Contributing Guide.
  • I have updated the documentation (if applicable).
  • My changes pass all local linting and formatting checks.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.
  • (For Core/Capability) I have included/updated the relevant JSON schemas.
  • I have regenerated Python Pydantic models by running generate_models.sh under python_sdk.

Screenshots / Logs (if applicable)

$ git ls-remote https://github.com/actions/checkout refs/tags/v5
fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09	refs/tags/v5
$ git ls-remote https://github.com/super-linter/super-linter refs/tags/v8
729e0f967409dceb0a898cdd94a5534719f85c36	refs/tags/v8
4ce20838b8ab83717e78138c5b3a1407148e0918	refs/tags/v8^{}
(each pin resolved to a 40-hex commit SHA; triggers and job commands unchanged)

$ uv run --no-project --with pyyaml python <workflow assertion script>
workflow-contracts-ok
# asserts: no mutable tags remain, every pinned SHA is 40-hex,
# linter/spellcheck permissions unchanged, read-only checkouts carry
# persist-credentials: false, pr-review-listener keeps its trigger and
# has permissions: {}

$ uvx zizmor --format plain .github/workflows/ (four changed files)
(no findings)

$ uvx pre-commit run --all-files
(all hooks passed)

@damaz91 damaz91 added the status:needs-triage Signal that the PR is ready for human triage label Sep 21, 2026

@damaz91 damaz91 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.

LGTM — thank you for hardening these validation workflows, @FanouZeng-TT!

Verified that all five action references (actions/checkout@v5, super-linter/super-linter/slim@v8, actions/setup-python@v6, pre-commit/action@v3.0.1, and streetsidesoftware/cspell-action@v8) resolve to their exact target commit SHAs and match the pins used across the sibling UCP repositories, and that persist-credentials: false and least-privilege permissions pass zizmor cleanly.

@damaz91 damaz91 added status:under-review and removed status:needs-triage Signal that the PR is ready for human triage labels Oct 30, 2026
@FanouZeng-TT

Copy link
Copy Markdown
Contributor Author

Friendly ping on this one — it was approved on 2026-10-30 and has been mergeable since.

For context, this is the last piece of the CI hardening series in this repo: the equivalent change already landed in ucp (#847), python-sdk (#99), js-sdk (#75/#76), and samples (#236), so this closes the gap where conformance was the only repository still referencing third-party Actions by mutable tag.

Nothing is pending on my side; happy to rebase or adjust if anything has moved since the approval.

@carolinerg1

Copy link
Copy Markdown

Thank you @FanouZeng-TT for submitting this and for the nudge!

One small non-blocking follow-up: .github/workflows/conventional-commits.yml (line 36) still references amannn/action-semantic-pull-request@v6 by tag. Would you mind pinning that one too in a quick follow-up so conformance is fully pinned. Thank you.

@carolinerg1
carolinerg1 merged commit 79a0f40 into Universal-Commerce-Protocol:main Nov 6, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants