summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorearl-warren <earl-warren@noreply.code.forgejo.org>2024-08-22 16:10:57 +0200
committerearl-warren <earl-warren@noreply.code.forgejo.org>2024-08-22 16:10:57 +0200
commit18352031084c9108e536188283f37c4acd337e17 (patch)
tree23af95d555f9595013e6ee4f62c1c616063deb7d
parentMerge pull request 'fix(jobparser): template job name if it's defined' (#41) ... (diff)
parentfix(jobparser): support `workflow_dispatch.inputs` (diff)
downloadforgejo-act-18352031084c9108e536188283f37c4acd337e17.tar.xz
forgejo-act-18352031084c9108e536188283f37c4acd337e17.zip
Merge pull request 'fix(jobparser): support `workflow_dispatch.inputs`' (#45) from viceice/fix-inputs into mainv1.21.1
Reviewed-on: https://code.forgejo.org/forgejo/act/pulls/45 Reviewed-by: earl-warren <earl-warren@noreply.code.forgejo.org>
-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) {