1
0
mirror of https://github.com/siderolabs/kres.git synced 2026-02-05 09:45:35 +01:00

feat: support setting condition for extra jobs under gh workflow

Support setting condition for extra jobs under gh workflow

Signed-off-by: Oguz Kilcan <oguz.kilcan@siderolabs.com>
This commit is contained in:
Oguz Kilcan
2026-01-13 20:17:10 +01:00
parent 0e8da31df6
commit 8b6181bc88

View File

@@ -100,6 +100,7 @@ type Step struct {
TriggerLabels []string `yaml:"triggerLabels"`
Artifacts Artifacts `yaml:"artifacts"`
NeedsOverride []string `yaml:"needsOverride"`
Condition string `yaml:"condition"`
} `yaml:"jobs"`
Artifacts Artifacts `yaml:"artifacts"`
Enabled bool `yaml:"enabled"`
@@ -465,6 +466,10 @@ func (step *Step) CompileGitHubWorkflow(output *ghworkflow.Output) error {
return fmt.Sprintf("contains(fromJSON(needs.default.outputs.labels), '%s')", label)
})
if job.Condition != "" {
conditions = append(conditions, job.Condition)
}
var artifactSteps []*ghworkflow.JobStep
if step.GHAction.Artifacts.Enabled {