Fix noisy runs-on
error logging (#2102)
Move the logging back up a level to fix a minor logging issue introduced in #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 ...` Co-authored-by: Jason Song <i@wolfogre.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
parent
1b10028447
commit
00fbfa754c
1 changed files with 4 additions and 1 deletions
|
@ -635,6 +635,10 @@ func (rc *RunContext) containerImage(ctx context.Context) string {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (rc *RunContext) runsOnImage(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) {
|
for _, platformName := range rc.runsOnPlatformNames(ctx) {
|
||||||
image := rc.Config.Platforms[strings.ToLower(platformName)]
|
image := rc.Config.Platforms[strings.ToLower(platformName)]
|
||||||
if image != "" {
|
if image != "" {
|
||||||
|
@ -649,7 +653,6 @@ func (rc *RunContext) runsOnPlatformNames(ctx context.Context) []string {
|
||||||
job := rc.Run.Job()
|
job := rc.Run.Job()
|
||||||
|
|
||||||
if job.RunsOn() == nil {
|
if job.RunsOn() == nil {
|
||||||
common.Logger(ctx).Errorf("'runs-on' key not defined in %s", rc.String())
|
|
||||||
return []string{}
|
return []string{}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue