Skip to content

deoomen/scripts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Scripts

A collection of shell utility scripts for me.

Script Description
_jira.sh Helper library — extracts a Jira issue number from a string
concurrent_requests.sh Fire multiple concurrent HTTP requests in parallel
git-pr-create.sh Create a GitHub draft pull request with a structured body
git-switch-create.sh Create and switch to a new Git branch with a sanitized name

_jira.sh

Internal helper library. Exposes extract_jira_issue_number_from_string — extracts a Jira-style issue number (e.g. ABC-123) from any string.

Not intended to be run directly. Source it in other scripts:

. $(dirname "$0")/_jira.sh

issue=$(extract_jira_issue_number_from_string "feature/ABC-123-my-feature")
# issue = "ABC-123"

concurrent_requests.sh

Fires a configurable number of concurrent HTTP PUT requests to a given endpoint using curl. Useful for load/concurrency testing.

Usage:

Edit the configuration variables at the top of the script, then run:

./concurrent_requests.sh

Configuration:

Variable Description
BASE_URL Base URL of the target server
JWT_TOKEN Bearer token for Authorization header
ENDPOINT Request path
CONCURRENT_REQUESTS Number of parallel requests to fire
REQUEST_BODY JSON body to send with each request

git-pr-create.sh

Creates a GitHub draft pull request assigned to you, with a structured body (## Opis: / ## Description: and optionally ## Jira:). Requires GitHub CLI (gh).

Usage:

./git-pr-create.sh <lang> <target-branch> <title> [body] [jira-company]

Arguments:

# Name Required Description
1 lang yes Language: pl (uses ## Opis:) or en (uses ## Description:)
2 target-branch yes Branch to merge into, e.g. main, master, develop
3 title yes Pull request title
4 body no PR body content. Defaults to _TODO_
5 jira-company no Jira company slug (e.g. mycompany). If provided, adds a ## Jira: section with the issue URL and prefixes the PR title with the issue number extracted from the branch name

Examples:

# Minimal
./git-pr-create.sh en main "Add login page"

# With body
./git-pr-create.sh pl develop "Dodaj stronę logowania" "Implementacja formularza logowania"

# With Jira
./git-pr-create.sh en main "Add login page" "Implements the login form" "mycompany"
# PR title becomes: "ABC-123 Add login page"
# Body includes: ## Jira: https://mycompany.atlassian.net/browse/ABC-123

git-switch-create.sh

Creates a new Git branch using a prefix/branch-name format, sanitizes the name (lowercase, hyphens only, max 64 chars), and switches to it.

Usage:

./git-switch-create.sh <prefix> <branch-name>

Arguments:

# Name Required Description
1 prefix yes Branch prefix, e.g. feature, fix, chore
2 branch-name yes Branch name — special characters are replaced with hyphens

Example:

./git-switch-create.sh feature "ABC-123 My new feature"
# creates: feature/abc-123-my-new-feature

About

Some useful scripts for me

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages