File tree Expand file tree Collapse file tree 4 files changed +29
-3
lines changed
Expand file tree Collapse file tree 4 files changed +29
-3
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,15 @@ All notable changes to this project will be documented in this file.
77The format is based on [ Keep a Changelog] ( https://keepachangelog.com/en/1.1.0/ ) ,
88and this project adheres to [ Semantic Versioning] ( https://semver.org/spec/v2.0.0.html ) .
99
10+ ## [ 0.6.0] - 2024-12-16
11+
12+ ### Added
13+
14+ - add ` create -r <user-reviewer> -t <team-reviewer> ` cli args to add reviewers at
15+ revision creation time. This is especially handy at creation of the first revision
16+ because one can omit the reviewers at PR creation and specify them only when
17+ first revision is published.
18+
1019## [ 0.5.0] - 2024-12-09
1120
1221### Added
@@ -75,3 +84,4 @@ Initial release.
7584[ 0.3.0 ] : https://github.com/hushsecurity/gh-pr-revision/compare/v0.2.0...v0.3.0
7685[ 0.4.0 ] : https://github.com/hushsecurity/gh-pr-revision/compare/v0.3.0...v0.4.0
7786[ 0.5.0 ] : https://github.com/hushsecurity/gh-pr-revision/compare/v0.4.0...v0.5.0
87+ [ 0.6.0 ] : https://github.com/hushsecurity/gh-pr-revision/compare/v0.5.0...v0.6.0
Original file line number Diff line number Diff line change @@ -220,6 +220,8 @@ func createRevision(args CreateArgs) error {
220220
221221 newRev .ExtendReviewers (revisions ... )
222222 newRev .ExtendReviewersFromApi (apiPr )
223+ newRev .ExtendUserReviewers (args .UserReviewer ... )
224+ newRev .ExtendTeamReviewers (args .TeamReviewer ... )
223225
224226 path , err := newPrComment (newRev , revisions )
225227 if err != nil {
Original file line number Diff line number Diff line change @@ -12,9 +12,11 @@ import (
1212var version string
1313
1414type CreateArgs struct {
15- Commitish string `arg:"-c, --commitish" help:"a commitish to associate the revision with (HEAD if omitted)"`
16- Edit bool `arg:"-e, --editor" help:"open an editor to add revision comment"`
17- Message string `arg:"-m, --message" help:"add this as revision comment"`
15+ Commitish string `arg:"-c, --commitish" help:"a commitish to associate the revision with (HEAD if omitted)"`
16+ Edit bool `arg:"-e, --editor" help:"open an editor to add revision comment"`
17+ Message string `arg:"-m, --message" help:"add this as revision comment"`
18+ UserReviewer []string `arg:"-r, --reviewer,separate" help:"add a user reviewer to the pull-request"`
19+ TeamReviewer []string `arg:"-t, --team-reviewer,separate" help:"add a team reviewer to the pull-request"`
1820}
1921
2022type DiffArgs struct {
Original file line number Diff line number Diff line change @@ -61,6 +61,18 @@ func (r *Revision) AddTeamReviewer(slug string) {
6161 r .TeamReviewers = append (r .TeamReviewers , slug )
6262}
6363
64+ func (r * Revision ) ExtendUserReviewers (reviewers ... string ) {
65+ for _ , login := range reviewers {
66+ r .AddUserReviewer (login )
67+ }
68+ }
69+
70+ func (r * Revision ) ExtendTeamReviewers (reviewers ... string ) {
71+ for _ , slug := range reviewers {
72+ r .AddTeamReviewer (slug )
73+ }
74+ }
75+
6476func (r * Revision ) ExtendReviewers (revisions ... Revision ) {
6577 for _ , other := range revisions {
6678 for _ , login := range other .UserReviewers {
You can’t perform that action at this time.
0 commit comments