Skip to content

Commit

Permalink
Fix noisy runs-on error logging
Browse files Browse the repository at this point in the history
Move the logging back up a level to fix a minor logging issue introduced in nektos#2088

`RunContext`s for composite actions have dummy/blank `Job`s with no `runs-on`,
meaning their calls to `withGithubEnv` would result in an inaccurate log message
complaining that `'runs-on' key not defined in ...`
  • Loading branch information
jenseng committed Nov 23, 2023
1 parent bd10c9a commit 96cd6cb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/runner/run_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,10 @@ func (rc *RunContext) containerImage(ctx context.Context) string {
}

func (rc *RunContext) runsOnImage(ctx context.Context) string {
if rc.Run.Job().RunsOn() == nil {
common.Logger(ctx).Errorf("'runs-on' key not defined in %s", rc.String())
}

for _, platformName := range rc.runsOnPlatformNames(ctx) {
image := rc.Config.Platforms[strings.ToLower(platformName)]
if image != "" {
Expand All @@ -649,7 +653,6 @@ func (rc *RunContext) runsOnPlatformNames(ctx context.Context) []string {
job := rc.Run.Job()

if job.RunsOn() == nil {
common.Logger(ctx).Errorf("'runs-on' key not defined in %s", rc.String())
return []string{}
}

Expand Down

0 comments on commit 96cd6cb

Please sign in to comment.