1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-03-21 21:07:19 +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], 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 return nil
} }
path := filepath.Join(ctx.Config.Brew.Folder, ctx.Config.Build.Binary+".rb") 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 ( import (
"errors" "errors"
"log"
"os" "os"
"github.com/goreleaser/goreleaser/context" "github.com/goreleaser/goreleaser/context"
) )
// ErrMissingToken indicates an error when GITHUB_TOKEN is missing in the environment // 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 // Pipe for env
type Pipe struct{} type Pipe struct{}
@ -22,10 +23,11 @@ func (Pipe) Description() string {
// Run the pipe // Run the pipe
func (Pipe) Run(ctx *context.Context) (err error) { func (Pipe) Run(ctx *context.Context) (err error) {
ctx.Token = os.Getenv("GITHUB_TOKEN")
if !ctx.Validate { if !ctx.Validate {
log.Println("Skipped validations because --skip-validate is set")
return nil return nil
} }
ctx.Token = os.Getenv("GITHUB_TOKEN")
if ctx.Token == "" { if ctx.Token == "" {
return ErrMissingToken return ErrMissingToken
} }

View File

@ -4,6 +4,7 @@ package git
import ( import (
"fmt" "fmt"
"log"
"regexp" "regexp"
"strings" "strings"
@ -65,6 +66,7 @@ func (Pipe) Run(ctx *context.Context) (err error) {
// removes usual `v` prefix // removes usual `v` prefix
ctx.Version = strings.TrimPrefix(tag, "v") ctx.Version = strings.TrimPrefix(tag, "v")
if !ctx.Validate { if !ctx.Validate {
log.Println("Skipped validation because --skip-validate is set")
return nil return nil
} }
return validate(commit, tag, ctx.Version) 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 { func doRun(ctx *context.Context, client client.Client) error {
if !ctx.Publish { if !ctx.Publish {
log.Println("Skipped because --skip-publish is set")
return nil return nil
} }
log.Println("Creating or updating release", ctx.Git.CurrentTag, "on", ctx.Config.Release.GitHub.String()) log.Println("Creating or updating release", ctx.Git.CurrentTag, "on", ctx.Config.Release.GitHub.String())