no-commit-to-branch linter fails in CI
#771
|
The no-commit-to-branch hook fails when run in a CI environment: I'm basically running amends "package://github.com/jdx/hk/releases/download/v1.39.0/hk@1.39.0#/Config.pkl"
import "package://github.com/jdx/hk/releases/download/v1.39.0/hk@1.39.0#/Builtins.pkl"
local linters = new Mapping<String, Step> {
["no-commit-to-branch"] = Builtins.no_commit_to_branch
}
hooks {
["pre-commit"] {
fix = true
stash = "git"
steps = linters
}
["pre-push"] {
steps = linters
}
["fix"] {
fix = true
steps = linters
}
["check"] {
steps = linters
}
}I'm attempting to fix by extending it with a condition so the hook doesn't run in CI. If I'm not wrong, it would be sensible to fix this upstream in the hook config. Thanks 🙏🏻 |
Answered by
gregbrowndev
Apr 3, 2026
Replies: 2 comments 4 replies
|
I think it doesn't make sense to use this step outside pre-commit |
4 replies
|
As suggested, I ended up going with: amends "package://github.com/jdx/hk/releases/download/v1.39.0/hk@1.39.0#/Config.pkl"
import "package://github.com/jdx/hk/releases/download/v1.39.0/hk@1.39.0#/Builtins.pkl"
local linters = new Mapping<String, Step> {
// other linters
}
hooks {
["pre-commit"] {
fix = true
stash = "git"
steps {
["no-commit-to-branch"] = Builtins.no_commit_to_branch
...linters
}
}
["pre-push"] {
steps = linters
}
["fix"] {
fix = true
steps = linters
}
["check"] {
steps = linters
}
} |
0 replies
Answer selected by
gregbrowndev
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As suggested, I ended up going with: