-
Notifications
You must be signed in to change notification settings - Fork 10
Closed
Labels
bugSomething isn't workingSomething isn't workinghelp wantedExtra attention is neededExtra attention is needed
Description
Describe the bug
- I get this warning every time I run pre-commit:
[WARNING] The 'rev' field of repo 'https://github.com/opensource-nepal/commitlint' appears to be a mutable reference (moving tag / branch). Mutable references are never updated after first install and are not supported. See https://pre-commit.com/#using-the-latest-version-for-a-repository for more details.
- No matter if I set a specific rev in
.pre-commit-config.yaml
, running the hook or autoupdate reverts it to just v1
To Reproduce
- install hook with specific rev
- run hook (So far so good.)
- Now run with
pre-commit autoupdate
and see the rev change
Expected behavior
- no warning
- if I use a specific rev in
.pre-commit-config.yaml
it should stick to it
Environment
- Python version: 3.12.4
- Package version: I'd like to say 1.2.0 but see above comments about rev not working properly
- Operating system: macOS 14.6.1
Additional context
the relevant .pre-commit-config.yaml
I set but running autoupdate
reverts it to just v1:
- repo: https://github.com/opensource-nepal/commitlint
rev: v1.2.0
hooks:
- id: commitlint
aj3sh
Metadata
Metadata
Labels
bugSomething isn't workingSomething isn't workinghelp wantedExtra attention is neededExtra attention is needed
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
aj3sh commentedon Aug 11, 2024
Thanks for reporting the bug.
We are creating a major and minor version tag afterward on every release to support GitHub Actions. This might be causing the issue, as pre-commit takes the latest created tag on autoupdate. We'll look into it in detail.
andreacfromtheapp commentedon Aug 11, 2024
thank you for your amazing tools and contributions :)
aj3sh commentedon Aug 12, 2024
Hi @gacallea, I have updated the tags for v1.2.0 and adjusted the order to v1.2.0, v1.2, and v1. However, it seems that pre-commit prioritizes the two-digit rev over the three-digit rev during autoupdate, and it doesn't show a warning message for the two-digit rev (minor version).
From my perspective, using a minor version tag rev in pre-commit is acceptable. I'll create a PR for it.
andreacfromtheapp commentedon Aug 12, 2024
Hi @aj3sh :)
thank you so much for looking into this and for coming up with a change so quickly!
One note if I may: there must be a way to use the full v1.2.0 tho, all other pre-commit hooks I have don't have the issue I reported. I suspect pre-commit is going to warn users with v.12 as well. What do you reckon?
aj3sh commentedon Aug 12, 2024
Taking reference from other official GitHub action tags, I have decided not to keep the two-digit tags (eg. v1.2) for GitHub actions. This immediately solves this issue.
Ref tags:
https://github.com/actions/checkout/tags
https://github.com/actions/setup-python/tags
@gacallea, now you can use
v1.2.0
without any issue :-). Thank you for using our tool.cc: @sugat009 , @golesuman , @subashcs
andreacfromtheapp commentedon Aug 12, 2024
amazing thanks! I confirm it already works :)