1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-10 03:47:03 +02:00
goreleaser/pipeline/env/env.go
Jorin Vogel 809cb682d2 Merge branch 'master' of https://github.com/goreleaser/goreleaser into tag-only
* 'master' of https://github.com/goreleaser/goreleaser:
  fixed name on --help
  removed unneeded pointers from context
2017-01-19 10:30:47 +01:00

29 lines
538 B
Go

package env
import (
"errors"
"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")
// Pipe for env
type Pipe struct{}
// Description of the pipe
func (Pipe) Description() string {
return "Loading environment variables"
}
// Run the pipe
func (Pipe) Run(ctx *context.Context) (err error) {
ctx.Token = os.Getenv("GITHUB_TOKEN")
if ctx.Token == "" {
return ErrMissingToken
}
return
}