Skip to content

Commit

Permalink
Merge pull request #12 from nekonenene/develop
Browse files Browse the repository at this point in the history
Release 2021-03-27 20:24
  • Loading branch information
nekonenene authored Mar 27, 2021
2 parents d375d47 + 216722a commit c5889f9
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 13 deletions.
17 changes: 11 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ This CLI app supports you to create a **release pull request**.

It fetches pull requests which merged into the development branch, and generates new pull request would merge into the production branch. If the pull request already exists, it updates the title and the body of that. This app will be convenient if your project follows git-flow.

<p align="center">
<img width="80%" alt="Screenshot of the Release Pull Request" src="https://user-images.githubusercontent.com/11713748/112718623-90307480-8f37-11eb-8139-a9bbf9b81ab1.png">
</p>


## Installation

Expand All @@ -22,7 +26,7 @@ go get github.com/nekonenene/gh-release-pr-generator@latest

## Usage

You need to get GitHub API Token, please see [here](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token).
First, you need to get GitHub API Token to control your repository, please see [here](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token).

### Example

Expand All @@ -41,11 +45,12 @@ gh-release-pr-generator --help
| Parameter | Description | Required? |
|:---:|:---:|:---:|
|-token| GitHub API Token | YES |
|-repo-owner| Repository Owner Name | YES |
|-repo-name| Repository Name | YES |
|-prod-branch| Production Branch Name (default: `main`) | |
|-dev-branch| Development Branch Name (default: `develop`) | |
|-template-path| PATH of the [Template File](#template-file) | |
|-repo-owner| Repository owner name | YES |
|-repo-name| Repository name | YES |
|-prod-branch| Production branch name (default: `main`) | |
|-dev-branch| Development branch name (default: `develop`) | |
|-template-path| PATH of the [template file](#template-file) | |
|-limit| Limit number of fetching pull requests (default: `100`) | |

### Template File

Expand Down
2 changes: 1 addition & 1 deletion src/cli/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func Exec() {
return
}

closedPulls, err := FetchClosedPullRequests(FetchPullRequestsLimitDefault)
closedPulls, err := FetchClosedPullRequests(params.FetchPullRequestsLimit)
if err != nil {
log.Fatal(err)
}
Expand Down
14 changes: 8 additions & 6 deletions src/cli/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ import (
)

type parameters struct {
GitHubAPIToken string
RepositoryOwner string
RepositoryName string
ProductionBranchName string
DevelopmentBranchName string
TemplatePath string
GitHubAPIToken string
RepositoryOwner string
RepositoryName string
ProductionBranchName string
DevelopmentBranchName string
TemplatePath string
FetchPullRequestsLimit int
}

var params parameters
Expand All @@ -23,6 +24,7 @@ func ParseParameters() {
flag.StringVar(&params.ProductionBranchName, "prod-branch", ProductionBranchNameDefault, "[Opiton] production branch name")
flag.StringVar(&params.DevelopmentBranchName, "dev-branch", DevelopmentBranchNameDefault, "[Opiton] development branch name")
flag.StringVar(&params.TemplatePath, "template-path", "", "[Opiton] template path for customizing the title and the body of the release pull request")
flag.IntVar(&params.FetchPullRequestsLimit, "limit", FetchPullRequestsLimitDefault, "[Opiton] limit number of fetching pull requests")
flag.Parse()

if params.GitHubAPIToken == "" {
Expand Down

0 comments on commit c5889f9

Please sign in to comment.