diff --git a/act/runner/step_action_remote.go b/act/runner/step_action_remote.go index 2df7e808..416ed1f5 100644 --- a/act/runner/step_action_remote.go +++ b/act/runner/step_action_remote.go @@ -312,7 +312,7 @@ func (ra *remoteAction) IsCheckout() bool { func newRemoteAction(action string) *remoteAction { // support http(s)://host/owner/repo@v3 - for _, schema := range []string{"https://", "http://"} { + for _, schema := range []string{"https://", "http://", "ssh://"} { if after, ok := strings.CutPrefix(action, schema); ok { splits := strings.SplitN(after, "/", 2) if len(splits) != 2 { diff --git a/act/runner/step_action_remote_test.go b/act/runner/step_action_remote_test.go index 0531d0ea..56c92252 100644 --- a/act/runner/step_action_remote_test.go +++ b/act/runner/step_action_remote_test.go @@ -778,6 +778,32 @@ func Test_newRemoteAction(t *testing.T) { }, wantCloneURL: "http://gitea.com/actions/aws", }, + { + action: "ssh://git@gitea.com/actions/heroku@main", // it's invalid for GitHub, but gitea supports it + want: &remoteAction{ + URL: "ssh://git@gitea.com", + Org: "actions", + Repo: "heroku", + Path: "", + Ref: "main", + }, + wantCloneURL: "ssh://git@gitea.com/actions/heroku", + }, + { + action: "ssh://git@gitea.com/actions/aws/ec2@main", // the ssh user is kept as part of the host segment + want: &remoteAction{ + URL: "ssh://git@gitea.com", + Org: "actions", + Repo: "aws", + Path: "ec2", + Ref: "main", + }, + wantCloneURL: "ssh://git@gitea.com/actions/aws", + }, + { + action: "ssh://gitea.com/onlyonesegment@main", // missing org/repo after the host + want: nil, + }, } for _, tt := range tests { t.Run(tt.action, func(t *testing.T) {