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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user