ci(workflows): fix hash-change labeller false-positive on every PR#1190
Merged
Conversation
The labeller in 105-flow-ats-static-checks.yaml used `grep -lE` over the current file contents, so any .sol file containing a `bytes32 constant = 0x<64-hex>` declaration matched — ~25% of .sol files in the repo declare such constants (resolver keys, storage slots, role hashes, ERC-7201 slots), so nearly every contract PR was getting the label regardless of whether a hash had actually changed. Switch to `git diff --name-only origin/<base> HEAD -G <hash_re>` so the label only fires when an added or removed line in the PR diff actually hits the hash pattern. The `scripts/codegen/` short-circuit is preserved — any change there is always hash-relevant. Signed-off-by: Miguel_LZPF <miguel.carpena@io.builders>
themariofrancia
approved these changes
May 25, 2026
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.
Description
The
hash-changelabeller in105-flow-ats-static-checks.yamlusedgrep -lEoverthe current file contents of every changed
.solfile. Because ~25% of.solfilesin the repo declare a
bytes32 constant = 0x<64-hex>(resolver keys, ERC-7201 storageslots, role hashes, etc.), nearly every contract PR was receiving the
hash-changelabelregardless of whether an actual hash value was added, removed, or modified.
Fix: switch to
git diff --name-only origin/<base> HEAD -G <hash_re>so the label onlyfires when an added or removed line in the PR diff itself matches the hash pattern.
The
scripts/codegen/short-circuit is preserved unchanged.Type of change
Testing
Workflow-only change — no application code was modified.
Verified the
git diff -Gregex logic locally against several PRs:bytes32 constantdeclaration → label NOT applied (was previously a false-positive).bytes32 constantvalue → label IS applied correctly.scripts/codegen/→ label IS applied via the short-circuit path.CI will validate workflow YAML syntax on this PR.
Node version: N/A — workflow-only change.
Checklist