PluginProbe
Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF / 2.2.8
Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF v2.2.8
2.3.4 2.3.3 2.3.2 2.3.1 2.3.0 2.2.9 2.2.8 trunk 1.10 1.3.3 1.3.4 1.3.5 1.3.5.1 1.3.5.2 1.3.6 1.3.6.1 1.4 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.5 All 103 releases
imagify / .aiassistant / skills / issue-workflow / scripts / make-issue-branch.sh

make-issue-branch.sh in Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF 2.2.8, at .aiassistant/skills/issue-workflow/scripts/make-issue-branch.sh

28 lines 971 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 #!/usr/bin/env bash
2 # Create a branch name from an issue number and title.
3 # Usage: make-issue-branch.sh <issue-number> "<issue-title>" [base-ref]
4 #
5 # base-ref: optional git ref to branch from (default: current HEAD).
6 # Pass an explicit ref such as "origin/chore/add-ai-assistant" when
7 # running inside a worktree or after a git fetch to avoid inheriting
8 # unexpected commits from a different branch.
9 set -euo pipefail
10
11 # Required arguments.
12 ISSUE_NUMBER="${1:?issue number required}"
13 TITLE="${2:?issue title required}"
14 BASE_REF="${3:-HEAD}"
15
16 # Build a short, URL-safe slug from the title (first 4 words max).
17 SLUG="$(printf '%s' "$TITLE" \
18 | tr '[:upper:]' '[:lower:]' \
19 | sed -E 's/[^a-z0-9]+/-/g; s/^-+//; s/-+$//' \
20 | cut -d- -f1-4)"
21
22 # Branch naming convention: fix/<issue>-<slug>
23 BRANCH="fix/${ISSUE_NUMBER}-${SLUG}"
24
25 # Create and switch to the branch from the explicit base.
26 git checkout -b "$BRANCH" "$BASE_REF"
27 echo "$BRANCH"
28