-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- gh-pr: Document -script-file flag - gh-pr: readme: Add an example - readme: Document required OAuth scopes (fixes #16)
- Loading branch information
1 parent
5913edb
commit fc851af
Showing
4 changed files
with
54 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,7 @@ Flags: | |
-repo= The pattern to match repository names | ||
-review= The GitHub user login to request the PR review from | ||
-script= The script to apply changes | ||
-script-file= Read the script from a file | ||
-shell= The shell to use to run the script. Default bash | ||
-title= The PR title | ||
-token Prompt for an Access Token | ||
|
@@ -37,6 +38,39 @@ Flags: | |
|
||
`GHTOOLS_TOKEN` and `GITHUB_TOKEN` in the order of precedence can be used to set a GitHub access token. | ||
|
||
### Examples | ||
### Example | ||
|
||
TBD. | ||
Walk over all repositories with names starting with `api-` in the GitHub organization `org` and for each repository upgrade `aws-sdk-go` to `v1.35.0`, create a respective pull request, assign it to `john` and request PR reviews from `chris` and `linda` | ||
|
||
```sh | ||
gh-pr -branch upgrade-aws-sdk-to-1-35 \ | ||
-assign john -review chris -review linda \ | ||
-title 'Update aws-sdk-go to v1.35.0' \ | ||
-desc 'Ref: issue#123' \ | ||
-script-file "$HOME/src/scripts/upgrade-aws-sdk.sh" \ | ||
-repo '^api-' org | ||
``` | ||
|
||
where `$HOME/src/scripts/upgrade-aws-sdk.sh` may look like this | ||
|
||
```sh | ||
#!/usr/bin/env bash | ||
|
||
if [ ! -f go.mod ]; then | ||
echo "There is no go.mod" | ||
exit | ||
fi | ||
|
||
version=$(go list -m -f '{{ .Version }}' github.com/aws/aws-sdk-go) | ||
if [ -z "$version" ]; then | ||
echo "No aws-sdk-go dependency" | ||
exit | ||
fi | ||
if [ "$version" == "v1.35.0" ]; then | ||
echo "Already using aws-sdk-go v1.35.0" | ||
exit | ||
fi | ||
|
||
go mod edit -require='github.com/aws/[email protected]' | ||
go mod tidy | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
package version | ||
|
||
var Version = "0.6.2" | ||
var Version = "0.6.3" |