Skip to content

Commit

Permalink
Print error with workflow/job information when runs-on key is not def…
Browse files Browse the repository at this point in the history
…ined (#494)

Co-authored-by: Casey Lee <cplee@nektos.com>
  • Loading branch information
Cat™ and cplee authored Jan 21, 2021
1 parent 719a077 commit e37b42a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/runner/run_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,10 @@ func (rc *RunContext) platformImage() string {
return rc.ExprEval.Interpolate(c.Image)
}

if job.RunsOn() == nil {
log.Errorf("'runs-on' key not defined in %s", rc.String())
}

for _, runnerLabel := range job.RunsOn() {
platformName := rc.ExprEval.Interpolate(runnerLabel)
image := rc.Config.Platforms[strings.ToLower(platformName)]
Expand All @@ -265,6 +269,10 @@ func (rc *RunContext) isEnabled(ctx context.Context) bool {

img := rc.platformImage()
if img == "" {
if job.RunsOn() == nil {
log.Errorf("'runs-on' key not defined in %s", rc.String())
}

for _, runnerLabel := range job.RunsOn() {
platformName := rc.ExprEval.Interpolate(runnerLabel)
l.Infof("\U0001F6A7 Skipping unsupported platform '%+v'", platformName)
Expand Down

0 comments on commit e37b42a

Please sign in to comment.