You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Report the Right Line in sha-pin When a Blank Line Precedes uses: #1966
The USES pattern in .github/actions/repo-gate/repo_gate.py is ^\s*-?\s*uses:\s*(?P<ref>[^\s#]+) under re.MULTILINE. \s matches a newline, so where a uses: line follows a blank line the match can begin on the blank line, and m.start() points there. Every sha-pin message that computes its line from m.start() then reports one line too low.
A constructed workflow jobs:\n a:\n\n uses: .github/x\n reports line 3, while the uses: sits on line 4.
Suggested fix
Anchor the leading whitespace to the line, for example ^[ \t]*-?[ \t]*uses:, and add a case with a blank line before the uses: asserting the reported line number.
Found by a local strict review on the pull request for #1889, outside that change's scope.
Activity
ptr727 commentedon Sep 28, 2026
Fixed on the pull request for #1889, #1967, in 7f6ebb7 and 8d13c78, and it closes on promotion.
Report a Bare .github/ Ref and Unquote Local Refs in sha-pin (#1967)