File tree Expand file tree Collapse file tree 3 files changed +13
-1
lines changed
Expand file tree Collapse file tree 3 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -128,7 +128,12 @@ func cliHandler(c *cli.Context) error {
128128 logger .Println ("calculating new version..." )
129129 newVer := semrel .GetNewVersion (conf , commits , release )
130130 if newVer == nil {
131- exitIfError (errors .New ("no change" ), 65 )
131+ if conf .AllowNoChanges {
132+ logger .Println ("no change" )
133+ os .Exit (0 )
134+ } else {
135+ exitIfError (errors .New ("no change" ), 65 )
136+ }
132137 }
133138 logger .Println ("new version: " + newVer .String ())
134139
Original file line number Diff line number Diff line change 2525 BetaRelease * BetaRelease
2626 Match string
2727 AllowInitialDevelopmentVersions bool
28+ AllowNoChanges bool
2829 GitLab bool
2930 GitLabBaseURL string
3031 GitLabProjectID string
@@ -51,6 +52,7 @@ func NewConfig(c *cli.Context) (*Config, error) {
5152 TravisCom : c .Bool ("travis-com" ),
5253 Match : c .String ("match" ),
5354 AllowInitialDevelopmentVersions : c .Bool ("allow-initial-development-versions" ),
55+ AllowNoChanges : c .Bool ("allow-no-changes" ),
5456 GitLab : c .Bool ("gitlab" ),
5557 GitLabBaseURL : c .String ("gitlab-base-url" ),
5658 GitLabProjectID : c .String ("gitlab-project-id" ),
Original file line number Diff line number Diff line change @@ -78,4 +78,9 @@ var CliFlags = []cli.Flag{
7878 Name : "allow-initial-development-versions" ,
7979 Usage : "semantic-release will start your initial development release at 0.1.0" ,
8080 },
81+ & cli.BoolFlag {
82+ Name : "allow-no-changes" ,
83+ Value : false ,
84+ Usage : "Exit with code 0 if no changes are found, useful if semantic-release is automatically run" ,
85+ },
8186}
You can’t perform that action at this time.
0 commit comments