test: add gh-pin pre-commit#447
Conversation
|
This is a test run that I ran in embedding example repo |
RobPasMue
left a comment
There was a problem hiding this comment.
I like it! I just see a few issues JSYK, but maybe we can document this. And solve/improve the logic-related ones
| modified = False | ||
|
|
||
| for line in lines: | ||
| bare = line.rstrip("\r\n") |
There was a problem hiding this comment.
This is only true for Windows files.. shouldn't you strip the line ending for LF files? (i.e. \n)
| # Constants | ||
| # --------------------------------------------------------------------------- | ||
|
|
||
| _GITHUB_API = "https://api.github.com" |
There was a problem hiding this comment.
This is going to fail on pre-commit.ci... pre-commit.ci has no access to the web.
| bare = line.rstrip("\r\n") | ||
| eol = line[len(bare) :] # preserves original line ending (LF or CRLF) |
There was a problem hiding this comment.
This logic seems a bit convoluted... you are only stripping on Windows, and preserving the line ending in other cases to store the eol... Can we clarify this logic and make it simpler?
Thank you. I will rectify the issues and thank you for the valuable feedbacks. |
Add
ghaction-pinpre-commit hookAdds a new hook that automatically pins GitHub Actions
uses:references from mutable tags to immutable commit SHAs, improving supply-chain security.Before:
After:
What it does
uses:lines missing a ref entirelyUsage