You've already forked goreleaser
							
							
				mirror of
				https://github.com/goreleaser/goreleaser.git
				synced 2025-10-30 23:58:09 +02:00 
			
		
		
		
	feat(cmd): release --draft (#4771)
closes #4767 Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
This commit is contained in:
		
				
					committed by
					
						 GitHub
						GitHub
					
				
			
			
				
	
			
			
			
						parent
						
							780a3a40d9
						
					
				
				
					commit
					c1615ea521
				
			| @@ -34,6 +34,7 @@ type releaseOpts struct { | ||||
| 	releaseFooterTmpl string | ||||
| 	autoSnapshot      bool | ||||
| 	snapshot          bool | ||||
| 	draft             bool | ||||
| 	failFast          bool | ||||
| 	clean             bool | ||||
| 	deprecated        bool | ||||
| @@ -98,6 +99,7 @@ func newReleaseCmd() *releaseCmd { | ||||
| 	_ = cmd.MarkFlagFilename("release-footer-tmpl", "md", "mkd", "markdown") | ||||
| 	cmd.Flags().BoolVar(&root.opts.autoSnapshot, "auto-snapshot", false, "Automatically sets --snapshot if the repository is dirty") | ||||
| 	cmd.Flags().BoolVar(&root.opts.snapshot, "snapshot", false, "Generate an unversioned snapshot release, skipping all validations and without publishing any artifacts (implies --skip=announce,publish,validate)") | ||||
| 	cmd.Flags().BoolVar(&root.opts.draft, "draft", false, "Whether to set the release to draft. Overrides release.draft in the configuration file") | ||||
| 	cmd.Flags().BoolVar(&root.opts.failFast, "fail-fast", false, "Whether to abort the release publishing on the first error") | ||||
| 	cmd.Flags().BoolVar(&root.opts.skipPublish, "skip-publish", false, "Skips publishing artifacts (implies --skip=announce)") | ||||
| 	cmd.Flags().BoolVar(&root.opts.skipAnnounce, "skip-announce", false, "Skips announcing releases (implies --skip=validate)") | ||||
| @@ -192,6 +194,8 @@ func setupReleaseContext(ctx *context.Context, options releaseOpts) error { | ||||
| 		ctx.Snapshot = true | ||||
| 	} | ||||
|  | ||||
| 	ctx.Config.Release.Draft = options.draft | ||||
|  | ||||
| 	if err := skips.SetRelease(ctx, options.skips...); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user