From be9f30c763cc5ed222dd704d3e04af6b1b328e2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Dro=C5=84?= Date: Tue, 14 Nov 2023 10:54:52 +0100 Subject: [PATCH] Display warning for long branch names (#4426) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add warning for branch names exceeding 37 characters * Add changeset * Fix copy --------- Co-authored-by: Paweł Chyła --- .changeset/two-bears-happen.md | 5 +++++ .husky/pre-push | 10 ++++++++++ 2 files changed, 15 insertions(+) create mode 100644 .changeset/two-bears-happen.md diff --git a/.changeset/two-bears-happen.md b/.changeset/two-bears-happen.md new file mode 100644 index 00000000000..26badfcd947 --- /dev/null +++ b/.changeset/two-bears-happen.md @@ -0,0 +1,5 @@ +--- +"saleor-dashboard": patch +--- + +Display warning for long branch names diff --git a/.husky/pre-push b/.husky/pre-push index d0eecb18f1d..d43c508b19f 100755 --- a/.husky/pre-push +++ b/.husky/pre-push @@ -1,5 +1,15 @@ #!/usr/bin/env sh . "$(dirname -- "$0")/_/husky.sh" +# Maximum allowed branch name length (deployment instance name limit) +MAX_LENGTH=37 + +# Check if the branch name length exceeds the maximum allowed length +branch_name=$(git symbolic-ref --short HEAD) +if [ ${#branch_name} -gt $MAX_LENGTH ]; then + echo "⚠️ Warning: Branch name '$branch_name' exceeds the maximum allowed length of $MAX_LENGTH characters." + echo "⚠️ The deployment instance will not be created." +fi + npm run check-types npm run test