diff --git a/main.go b/main.go index 7c0eaf4..25aa15d 100644 --- a/main.go +++ b/main.go @@ -37,6 +37,12 @@ func main() { ctx, cancel := context.WithTimeout(context.Background(), inputs.Timeout) setupInterruptHandler(cancel) + // Output some information + githubOptions := opts.GitHub + if githubOptions.RunningAsAction { + logrus.Infof("==== Running workflow %s for %s@%s ====", githubOptions.Workflow, githubOptions.Ref, githubOptions.Commit) + } + // deploy the template resultDeployment, err := actions.Deploy(ctx, inputs) if err != nil { @@ -46,6 +52,9 @@ func main() { // output the deploymentname github.SetOutput("deploymentName", *resultDeployment.Name) + if githubOptions.RunningAsAction { + logrus.Info("==== Successfully finished running the workflow ====") + } } func setupInterruptHandler(cancel func()) { diff --git a/pkg/github/options.go b/pkg/github/options.go index 7fa67b9..4562b4a 100644 --- a/pkg/github/options.go +++ b/pkg/github/options.go @@ -27,14 +27,15 @@ import ( // GitHub represents the inputs which github provides us on default type GitHub struct { - Workflow string `env:"GITHUB_WORKFLOW"` - Action string `env:"GITHUB_ACTION"` - Actor string `env:"GITHUB_ACTOR"` - Repository string `env:"GITHUB_REPOSITORY"` - Commit string `env:"GITHUB_SHA"` - EventName string `env:"GITHUB_EVENT_NAME"` - EventPath string `env:"GITHUB_EVENT_PATH"` - Ref string `env:"GITHUB_REF"` + Workflow string `env:"GITHUB_WORKFLOW"` + Action string `env:"GITHUB_ACTION"` + Actor string `env:"GITHUB_ACTOR"` + Repository string `env:"GITHUB_REPOSITORY"` + Commit string `env:"GITHUB_SHA"` + EventName string `env:"GITHUB_EVENT_NAME"` + EventPath string `env:"GITHUB_EVENT_PATH"` + Ref string `env:"GITHUB_REF"` + RunningAsAction bool `env:"GITHUB_ACTIONS" envDefault:"false"` } // Inputs represents our custom inputs for the action