diff --git a/githooks/pre-push/kubeapps b/githooks/pre-commit/kubeapps old mode 100644 new mode 100755 similarity index 55% rename from githooks/pre-push/kubeapps rename to githooks/pre-commit/kubeapps index 0f2e27f7f6..29f831425f --- a/githooks/pre-push/kubeapps +++ b/githooks/pre-commit/kubeapps @@ -1,9 +1,6 @@ #!/bin/bash -currentBranch="$(git rev-parse --abbrev-ref HEAD)" -originCommit="$(git rev-parse --short "$(git merge-base master "$currentBranch")")" - -if git diff --name-only "$originCommit" | grep '/kubeapps/'; then +if git diff --name-only --cached | grep '/kubeapps/'; then printf '\n\U1F6AB Pull Request cancelled\n\nKubeapps changes detected in this repository.\nPlease, implement them in the kubeapps repository (https://github.com/kubeapps/kubeapps/tree/master/chart/kubeapps).\n' exit 1 fi diff --git a/githooks/pre-push/upstreamed b/githooks/pre-commit/upstreamed old mode 100644 new mode 100755 similarity index 51% rename from githooks/pre-push/upstreamed rename to githooks/pre-commit/upstreamed index ac96e884f3..7e4e60255f --- a/githooks/pre-push/upstreamed +++ b/githooks/pre-commit/upstreamed @@ -1,9 +1,6 @@ #!/bin/bash -currentBranch="$(git rev-parse --abbrev-ref HEAD)" -originCommit="$(git rev-parse --short "$(git merge-base master "$currentBranch")")" - -if git diff --name-only "$originCommit" | grep '/upstreamed/'; then +if git diff --name-only --cached | grep '/upstreamed/'; then printf '\n\U1F6AB Pull Request cancelled\n\nChanges detected in the "upstreamed" folder.\nPlease, implement them in the Helm Charts repository (https://github.com/helm/charts).\n' exit 1 fi diff --git a/githooks/pre-push/helm-lint b/githooks/pre-push/helm-lint old mode 100644 new mode 100755 index f850fd1aa1..3324602d07 --- a/githooks/pre-push/helm-lint +++ b/githooks/pre-push/helm-lint @@ -1,5 +1,7 @@ #!/bin/bash +## TODO: Only check folders in the bitnami/ path + currentBranch="$(git rev-parse --abbrev-ref HEAD)" originCommit="$(git rev-parse --short "$(git merge-base master "$currentBranch")")" filesToBePushed="$(git diff --name-only "$originCommit")"