mirror of
https://code.forgejo.org/forgejo/runner.git
synced 2025-09-15 18:57:01 +00:00
Print error with workflow/job information when runs-on key is not defined (#494)
Co-authored-by: Casey Lee <cplee@nektos.com>
This commit is contained in:
parent
be1a537618
commit
0f29955368
1 changed files with 8 additions and 0 deletions
|
@ -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)]
|
||||
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue