mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-01-26 04:22:05 +02:00
29 lines
423 B
Go
29 lines
423 B
Go
|
package env
|
||
|
|
||
|
import (
|
||
|
"errors"
|
||
|
"os"
|
||
|
|
||
|
"github.com/goreleaser/releaser/context"
|
||
|
)
|
||
|
|
||
|
var ErrMissingToken = errors.New("Missing GITHUB_TOKEN")
|
||
|
|
||
|
// Pipe for env
|
||
|
type Pipe struct{}
|
||
|
|
||
|
// Name of the pipe
|
||
|
func (Pipe) Name() string {
|
||
|
return "Env"
|
||
|
}
|
||
|
|
||
|
// Run the pipe
|
||
|
func (Pipe) Run(ctx *context.Context) (err error) {
|
||
|
token := os.Getenv("GITHUB_TOKEN")
|
||
|
if token == "" {
|
||
|
return ErrMissingToken
|
||
|
}
|
||
|
ctx.Token = &token
|
||
|
return
|
||
|
}
|