Skip to content

Commit

Permalink
Display warning for long branch names (#4426)
Browse files Browse the repository at this point in the history
* Add warning for branch names exceeding 37 characters

* Add changeset

* Fix copy

---------

Co-authored-by: Paweł Chyła <[email protected]>
  • Loading branch information
Droniu and poulch committed Dec 18, 2023
1 parent d4f396d commit 1da2476
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/two-bears-happen.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"saleor-dashboard": patch
---

Display warning for long branch names
10 changes: 10 additions & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 1da2476

Please sign in to comment.