https://github.com/sheldonhull/az-pr
A simple cli wrapper around the azure-cli for creating pull requests in azure devops repos.
https://github.com/sheldonhull/az-pr
Last synced: 10 months ago
JSON representation
A simple cli wrapper around the azure-cli for creating pull requests in azure devops repos.
- Host: GitHub
- URL: https://github.com/sheldonhull/az-pr
- Owner: sheldonhull
- License: mit
- Created: 2023-02-09T01:18:11.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-12-02T01:12:53.000Z (over 1 year ago)
- Last Synced: 2024-12-08T13:49:00.756Z (over 1 year ago)
- Language: Go
- Size: 7.26 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# AZ-PR
[](https://forthebadge.com)



[](https://forthebadge.com)
A go cli for wrapping up azure cli pr creation, eliminating the need to do in the web-ui or clunky git aliases.
# Disclaimer
It's a wrapper and done with limited time so lots to cleanup, but since it's replacing a bash script it's still better than nothing! 😀
Feel free to create a PR or an issue for any issues experienced and if I can improve it I will.
Hope it helps you out in your workflow a bit and helps you avoid the Azure DevOps web ui a litle bit longer.
## Install
Use Go 1.18+.
This should grab the latest tagged version.
Upgrade the same way.
```shell
go install github.com/sheldonhull/az-pr@latest
```
## Check Requirements
You need to have an access token configured, so this will check and make sure the requirements to run are setup correctly.
```shell
az-pr check
```
## Install from Source With Go
If you don't have Go tools typically setup, then here's something to add your profile to make sure the binary is found.
This would be your `$HOME/.zshenv` or `$HOME/.bashrc`.
```shell
export PATH="$(go env GOPATH)/bin:${PATH}"
```
Find this file by typing `code $PROFILE` in a PowerShell prompt to open/create it on demand.
This profile is different depending on where you load it from, so VSCode has a unique profile as well as a normal terminal.
[Profile Files](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_profiles?view=powershell-7.3)
```powershell
$GOPATH=&go env GOPATH
$ENV:PATH = '{0}{1}{2}' -f (Join-Path $GOPATH 'bin'), [IO.Path]::PathSeparator, $ENV:PATH
```
## Why
I could do this in a shell script (which I've done), but wanted to make it easy for a Go dev to run with a nice prompting experience that was compatible with Linux/MacOS/Windows.
I use conventional commits in all repos, and this should make it much easier to create pull requests without dealing with the web-ui.
In addition, it will set auto-complete and link work-items.
## Why A Wrapper
The cli has a lot of logic already built in.
I couldn't find a documented Azure DevOps Go SDK for repos.
Might redo with API calls, but the cli is an easy quick win. 😀