Skip to content

Commit

Permalink
[check-helm-version] Use main_eersion (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
jtyr committed Mar 19, 2024
1 parent 97ff64e commit a4d70a5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ checks:
```yaml
repos:
- repo: https://github.com/jtyr/pre-commit-hooks
rev: v1.3.1
rev: v1.3.2
hooks:
- id: docker-image
name: Run /tools/validate.sh in container
Expand All @@ -45,7 +45,7 @@ Helm chart version, this hook helps to prevent the overwrite.
```yaml
repos:
- repo: https://github.com/jtyr/pre-commit-hooks
rev: v1.3.1
rev: v1.3.2
hooks:
- id: check-helm-version
```
Expand All @@ -57,7 +57,7 @@ the `--branch` argument:
```yaml
repos:
- repo: https://github.com/jtyr/pre-commit-hooks
rev: v1.3.1
rev: v1.3.2
hooks:
- id: check-helm-version
args:
Expand All @@ -71,7 +71,7 @@ argument:
```yaml
repos:
- repo: https://github.com/jtyr/pre-commit-hooks
rev: v1.3.1
rev: v1.3.2
hooks:
- id: check-helm-version
args:
Expand All @@ -85,7 +85,7 @@ the `--autofix` argument:
```yaml
repos:
- repo: https://github.com/jtyr/pre-commit-hooks
rev: v1.3.1
rev: v1.3.2
hooks:
- id: check-helm-version
args:
Expand All @@ -99,7 +99,7 @@ with the `--autofix-portion` argument:
```yaml
repos:
- repo: https://github.com/jtyr/pre-commit-hooks
rev: v1.3.1
rev: v1.3.2
hooks:
- id: check-helm-version
args:
Expand Down
12 changes: 5 additions & 7 deletions hooks/check_helm_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,17 +223,15 @@ def check_chart(
log.info("Autofixing the %s portion of the version" % autofix_portion)

if autofix_portion == "major":
current_yaml["version"] = semver.bump_major(current_yaml["version"])
current_yaml["version"] = semver.bump_major(main_yaml["version"])
elif autofix_portion == "minor":
current_yaml["version"] = semver.bump_minor(current_yaml["version"])
current_yaml["version"] = semver.bump_minor(main_yaml["version"])
elif autofix_portion == "patch":
current_yaml["version"] = semver.bump_patch(current_yaml["version"])
current_yaml["version"] = semver.bump_patch(main_yaml["version"])
elif autofix_portion == "prerelease":
current_yaml["version"] = semver.bump_prerelease(
current_yaml["version"]
)
current_yaml["version"] = semver.bump_prerelease(main_yaml["version"])
elif autofix_portion == "build":
current_yaml["version"] = semver.bump_build(current_yaml["version"])
current_yaml["version"] = semver.bump_build(main_yaml["version"])

log.info("Autofixed version: %s" % current_yaml["version"])

Expand Down

0 comments on commit a4d70a5

Please sign in to comment.