A GitHub CLI alias that helps streamline the process of starting work on a new task by automating branch creation and pull request setup.
This alias is installed automatically when you run the installation script:
./scripts/install-aliases.sh
gh start-work <JIRA_TICKET> [ISSUE_TYPE]
JIRA_TICKET
(Required): The Jira ticket number/ID that this work relates toISSUE_TYPE
(Optional): Type of issue you're working on. Defaults to "feature"- Valid values:
feature
,bug
,maintenance
,chore
- Valid values:
--help
: Display help information about the command
# Start work on a feature
gh start-work PROJ-123
# Start work on a bug fix
gh start-work PROJ-456 bug
# Start work on a maintenance task
gh start-work PROJ-789 maintenance
# Start work on a chore
gh start-work PROJ-101 chore
When you run this command, it will:
- Create a new branch named
<ISSUE_TYPE>/<JIRA_TICKET>
- Append a new section to
.changes.md
with the branch name as the title - Commit the updated
.changes.md
file - Push the branch to the remote repository
- Create a pull request in DRAFT state with:
- Title: Branch name
- Body: "Work started on <branch_name>"
- Base branch: main
- Git repository with an origin remote configured
- GitHub CLI installed and authenticated
- Write access to the repository
The command will fail with an appropriate error message if:
- No JIRA ticket is provided
- An invalid issue type is specified
- No git origin remote is configured
- GitHub CLI encounters any errors during PR creation
If you'd like to contribute to this alias, please submit a pull request with your proposed changes.