Skip to content

kpiegza/Bookmarklet-Branch-Generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bookmarklet Branch Generator

Browser bookmarklet to generate normalized git branch names from Jira issues.

Features

  • Extracts issue key, title, and epic name from Jira pages
  • Generates branch names using AI (n8n webhook) or locally
  • Auto-detects issue type (incident → bugfix/, other → feature/)
  • Caches generated branch names in localStorage
  • Toast notifications for status feedback
  • One-click copy to clipboard

Installation

npm install

Configuration

Copy .env.example to .env and configure:

# URL where branch-generator.js is hosted
BASE_URL=https://your-domain.com/path

# n8n webhook for AI branch generation (optional)
N8N_WEBHOOK_URL=https://your-n8n-instance.com/webhook/branch-generator
JWT_SECRET=your-jwt-secret-key

# S3 upload configuration
S3_ACCESS_KEY_ID=your-access-key
S3_SECRET_ACCESS_KEY=your-secret-key
S3_REGION=ocdn
S3_ENDPOINT=https://ocdn.eu/
S3_BUCKET=bucket-name
S3_BASE_PATH=folder/subfolder

Scripts

Command Description
npm run dev Start dev server with hot reload
npm run build Build for development
npm run build:prod Build for production (minified)
npm run upload Upload build files to S3
npm run deploy Build production + upload to S3

Usage

  1. Run npm run deploy to build and upload to S3
  2. Copy content of build/loader-bundled.js
  3. Create new bookmark in browser with the copied content as URL
  4. Open a Jira issue and click the bookmark
  5. Branch name is copied to clipboard

Project Structure

src/
├── index.js                 # Main entry point
├── loader.js                # Bookmarklet loader
└── modules/
    ├── config.js            # Configuration constants
    ├── api.js               # n8n webhook API
    ├── branch.js            # Branch name generation
    ├── clipboard.js         # Clipboard operations
    ├── jira.js              # Jira data extraction
    ├── storage.js           # localStorage cache
    └── toast/
        ├── index.js         # Toast notifications
        └── styles.js        # Toast CSS styles

Branch Naming

Generated branch format: {prefix}/{ISSUE-KEY}-{epic}-{title}

Issue Type Prefix
Incident / INC-* bugfix/
Other feature/

Example: feature/ABC-123-epic-name-issue-title

Build Output

build/
├── loader-bundled.js     # Bookmarklet (with javascript: prefix)
└── branch-generator.js   # Main script (hosted on S3)

License

MIT

About

Browser bookmarklet for generating normalized Git branch names from Jira issues.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors