ci: harden lint workflow - #38
Open
msarkor718 wants to merge 1 commit into
Open
Conversation
Author
|
Note on the red checks — both predate this PR.
The job aborts before the linter runs, so this PR cannot produce a green check and did not cause the failure. Bumping the cache action to v3/v4 is safe once this lands — the hardening here is in the same file, so a later bump cannot re-arm the path this closes. Worth pinning |
msarkor718
force-pushed
the
ci/harden-lint-workflow
branch
from
July 30, 2026 19:37
f541c5e to
9d5113f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Applies the hardening from Uniswap/v3-core#1091 to this repository's
.github/workflows/lint.yml, closing thepostinstall→GITHUB_TOKEN→ commit-injection class of CI supply-chain risk.Three changes, matching v3-core:
permissions: contents: readat the workflow level, so the job no longer runs with awrite-capable
GITHUB_TOKEN.yarn --frozen-lockfile --ignore-scripts. The lockfile flag only prevents lockfile mutation;preinstall/install/postinstallscripts still execute.--ignore-scriptsdisables them,so a poisoned dependency introduced in a PR cannot run arbitrary code on the runner.
auto_fix: falseand removal ofgithub_tokenfromwearerequired/lint-action. Lintviolations are reported rather than auto-pushed, and the runner no longer holds a write
credential a malicious step could exfiltrate.
Why
On
pull_requestevents from same-repo branches this job runs with a write-capableGITHUB_TOKEN. Combined with dependency lifecycle scripts enabled andauto_fix: true(token-authored pushes), there is a usable path from "open a PR touching dependencies" to
"push commits using the workflow's token." This closes that path without changing what the
linter verifies.
Behavior preserved: the linter runs over the same file extensions, and failing lint still
fails the check.
Behavior removed: the workflow can no longer push commits to branches. Lint issues are fixed
locally, which is GitHub's recommended pattern.
Note on CI status
This workflow also pins
actions/cache@v1, which GitHub now hard-fails during actionresolution — so the lint job currently aborts before the linter runs, and this PR will not
produce a green lint check. That deprecation is unrelated to this change and is left alone here.
Worth flagging for whoever bumps it later: restoring the cache action re-arms the exact path
this PR closes, unless this lands first. Landing this first makes that bump safe.
Test plan
lint.ymlwriting to the repository.🤖 Generated with Claude Code