1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-03-19 20:57:53 +02:00

logging the reasons why a pipe is being skipped

This commit is contained in:
Carlos Alexandro Becker 2017-04-21 11:48:00 -03:00
parent 5e6c8b2f41
commit 4aa47c5866
No known key found for this signature in database
GPG Key ID: E61E2F7DC14AB940
4 changed files with 13 additions and 3 deletions

View File

@ -103,7 +103,12 @@ func doRun(ctx *context.Context, client client.Client) error {
Name: ss[1],
}
}
if ctx.Config.Brew.GitHub.Name == "" || !ctx.Publish {
if !ctx.Publish {
log.Println("Skipped because --skip-publish is set")
return nil
}
if ctx.Config.Brew.GitHub.Name == "" {
log.Println("Skipped because brew section is not configured")
return nil
}
path := filepath.Join(ctx.Config.Brew.Folder, ctx.Config.Build.Binary+".rb")

6
pipeline/env/env.go vendored
View File

@ -4,13 +4,14 @@ package env
import (
"errors"
"log"
"os"
"github.com/goreleaser/goreleaser/context"
)
// ErrMissingToken indicates an error when GITHUB_TOKEN is missing in the environment
var ErrMissingToken = errors.New("Missing GITHUB_TOKEN")
var ErrMissingToken = errors.New("missing GITHUB_TOKEN")
// Pipe for env
type Pipe struct{}
@ -22,10 +23,11 @@ func (Pipe) Description() string {
// Run the pipe
func (Pipe) Run(ctx *context.Context) (err error) {
ctx.Token = os.Getenv("GITHUB_TOKEN")
if !ctx.Validate {
log.Println("Skipped validations because --skip-validate is set")
return nil
}
ctx.Token = os.Getenv("GITHUB_TOKEN")
if ctx.Token == "" {
return ErrMissingToken
}

View File

@ -4,6 +4,7 @@ package git
import (
"fmt"
"log"
"regexp"
"strings"
@ -65,6 +66,7 @@ func (Pipe) Run(ctx *context.Context) (err error) {
// removes usual `v` prefix
ctx.Version = strings.TrimPrefix(tag, "v")
if !ctx.Validate {
log.Println("Skipped validation because --skip-validate is set")
return nil
}
return validate(commit, tag, ctx.Version)

View File

@ -27,6 +27,7 @@ func (Pipe) Run(ctx *context.Context) error {
func doRun(ctx *context.Context, client client.Client) error {
if !ctx.Publish {
log.Println("Skipped because --skip-publish is set")
return nil
}
log.Println("Creating or updating release", ctx.Git.CurrentTag, "on", ctx.Config.Release.GitHub.String())