summaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorThomas Eddy <2780096+ImTomEddy@users.noreply.github.com>2023-07-19 23:45:44 +0200
committerGitHub <noreply@github.com>2023-07-19 23:45:44 +0200
commit83b0a5b1f2cbc19338fa57659c51695744e89730 (patch)
treec670bd2468fcedb1685e6b1cb09242189408fe53 /cmd
parentbuild(deps): bump github.com/moby/buildkit from 0.11.6 to 0.12.0 (#1917) (diff)
downloadforgejo-act-83b0a5b1f2cbc19338fa57659c51695744e89730.tar.xz
forgejo-act-83b0a5b1f2cbc19338fa57659c51695744e89730.zip
Add new CLI flag to log just the job id and not the entire job name (#1920)
* Add new CLI flag to log just the job id and not the entire job name * Up the action test timeout to 20m from 15m
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 64556e1..1ae2793 100644
--- a/cmd/input.go
+++ b/cmd/input.go
@@ -55,6 +55,7 @@ type Input struct {
replaceGheActionTokenWithGithubCom string
matrix []string
actionCachePath string
+ logPrefixJobID bool
}
func (i *Input) resolve(path string) string {
diff --git a/cmd/root.go b/cmd/root.go
index f7b6515..679d20e 100644
--- a/cmd/root.go
+++ b/cmd/root.go
@@ -75,6 +75,7 @@ func Execute(ctx context.Context, version string) {
rootCmd.PersistentFlags().StringVarP(&input.workdir, "directory", "C", ".", "working directory")
rootCmd.PersistentFlags().BoolP("verbose", "v", false, "verbose output")
rootCmd.PersistentFlags().BoolVar(&input.jsonLogger, "json", false, "Output logs in json format")
+ rootCmd.PersistentFlags().BoolVar(&input.logPrefixJobID, "log-prefix-job-id", false, "Output the job id within non-json logs instead of the entire name")
rootCmd.PersistentFlags().BoolVarP(&input.noOutput, "quiet", "q", false, "disable logging of output from steps")
rootCmd.PersistentFlags().BoolVarP(&input.dryrun, "dryrun", "n", false, "dryrun mode")
rootCmd.PersistentFlags().StringVarP(&input.secretfile, "secret-file", "", ".secrets", "file with list of secrets to read from (e.g. --secret-file .secrets)")
@@ -584,6 +585,7 @@ func newRunCommand(ctx context.Context, input *Input) func(*cobra.Command, []str
BindWorkdir: input.bindWorkdir,
LogOutput: !input.noOutput,
JSONLogger: input.jsonLogger,
+ LogPrefixJobID: input.logPrefixJobID,
Env: envs,
Secrets: secrets,
Vars: vars,