summaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorRyan <me@hackerc.at>2022-04-04 19:53:08 +0200
committerGitHub <noreply@github.com>2022-04-04 19:53:08 +0200
commitd4272bd9fe13566ab76e5ad091aedbded74ff4e2 (patch)
tree90a301156ec081c460f1dfd1fc34aaee4b6b6c8f /cmd
parentAllow passed in env vars to supersede ones declared in the workflow (#1100) (diff)
downloadforgejo-act-d4272bd9fe13566ab76e5ad091aedbded74ff4e2.tar.xz
forgejo-act-d4272bd9fe13566ab76e5ad091aedbded74ff4e2.zip
feat: add option to specify git remote name (#1104)
fixes https://github.com/nektos/act/issues/1099 fixes https://github.com/nektos/act/issues/983 Signed-off-by: Ryan <me@hackerc.at> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/input.go1
-rw-r--r--cmd/root.go2
2 files changed, 3 insertions, 0 deletions
diff --git a/cmd/input.go b/cmd/input.go
index ed6e36b..cd3397b 100644
--- a/cmd/input.go
+++ b/cmd/input.go
@@ -40,6 +40,7 @@ type Input struct {
artifactServerPort string
jsonLogger bool
noSkipCheckout bool
+ remoteName string
}
func (i *Input) resolve(path string) string {
diff --git a/cmd/root.go b/cmd/root.go
index 9567a42..a94f692 100644
--- a/cmd/root.go
+++ b/cmd/root.go
@@ -43,6 +43,7 @@ func Execute(ctx context.Context, version string) {
rootCmd.Flags().StringP("job", "j", "", "run job")
rootCmd.Flags().BoolP("bug-report", "", false, "Display system information for bug report")
+ rootCmd.Flags().StringVar(&input.remoteName, "remote-name", "origin", "git remote name that will be used to retrieve url of git repo")
rootCmd.Flags().StringArrayVarP(&input.secrets, "secret", "s", []string{}, "secret to make available to actions with optional value (e.g. -s mysecret=foo or -s mysecret)")
rootCmd.Flags().StringArrayVarP(&input.envs, "env", "", []string{}, "env to make available to actions with optional value (e.g. --env myenv=foo or --env myenv)")
rootCmd.Flags().StringArrayVarP(&input.platforms, "platform", "P", []string{}, "custom image to use per platform (e.g. -P ubuntu-18.04=nektos/act-environments-ubuntu:18.04)")
@@ -379,6 +380,7 @@ func newRunCommand(ctx context.Context, input *Input) func(*cobra.Command, []str
ArtifactServerPath: input.artifactServerPath,
ArtifactServerPort: input.artifactServerPort,
NoSkipCheckout: input.noSkipCheckout,
+ RemoteName: input.remoteName,
}
r, err := runner.New(config)
if err != nil {