summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Kriese <michael.kriese@visualon.de>2024-08-22 14:25:17 +0200
committerMichael Kriese <michael.kriese@visualon.de>2024-08-22 15:02:05 +0200
commitbe182ffdfa02916b7ba148e76a1f4fea416b7721 (patch)
tree23af95d555f9595013e6ee4f62c1c616063deb7d
parentMerge pull request 'fix(jobparser): template job name if it's defined' (#41) ... (diff)
downloadforgejo-act-be182ffdfa02916b7ba148e76a1f4fea416b7721.tar.xz
forgejo-act-be182ffdfa02916b7ba148e76a1f4fea416b7721.zip
fix(jobparser): support `workflow_dispatch.inputs`
-rw-r--r--pkg/jobparser/model.go5
-rw-r--r--pkg/jobparser/model_test.go8
2 files changed, 13 insertions, 0 deletions
diff --git a/pkg/jobparser/model.go b/pkg/jobparser/model.go
index 2ad615d..f63a045 100644
--- a/pkg/jobparser/model.go
+++ b/pkg/jobparser/model.go
@@ -259,6 +259,11 @@ func ParseRawOn(rawOn *yaml.Node) ([]*Event, error) {
return nil, fmt.Errorf("unknown on type: %#v", branches)
}
}
+ case map[string]interface{}:
+ if k != "workflow_dispatch" || act != "inputs" {
+ return nil, fmt.Errorf("unknown on type: %#v", v)
+ }
+ acts = nil
default:
return nil, fmt.Errorf("unknown on type: %#v", branches)
}
diff --git a/pkg/jobparser/model_test.go b/pkg/jobparser/model_test.go
index 859ee92..a034306 100644
--- a/pkg/jobparser/model_test.go
+++ b/pkg/jobparser/model_test.go
@@ -186,6 +186,14 @@ func TestParseRawOn(t *testing.T) {
},
},
},
+ {
+ input: "on:\n workflow_dispatch:\n inputs:\n test:\n type: string",
+ result: []*Event{
+ {
+ Name: "workflow_dispatch",
+ },
+ },
+ },
}
for _, kase := range kases {
t.Run(kase.input, func(t *testing.T) {