From e0569775060978492aed4494ab949d289856be12 Mon Sep 17 00:00:00 2001 From: Rotem Tamir Date: Mon, 25 Dec 2023 20:33:20 +0200 Subject: [PATCH] cmd/main: set env var with action name --- cmd/atlas-action/main.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd/atlas-action/main.go b/cmd/atlas-action/main.go index 2946b8fc..90854f0f 100644 --- a/cmd/atlas-action/main.go +++ b/cmd/atlas-action/main.go @@ -8,6 +8,7 @@ import ( "context" "errors" "fmt" + "os" "ariga.io/atlas-action/atlasaction" "ariga.io/atlas-go-sdk/atlasexec" @@ -61,6 +62,10 @@ type RunAction struct { } func (r *RunAction) Run(ctx context.Context, client *atlasexec.Client, action *githubactions.Action) error { + _ = os.Setenv("ATLAS_ACTION_COMMAND", r.Action) + defer func() { + _ = os.Unsetenv("ATLAS_ACTION_COMMAND") + }() switch r.Action { case CmdMigrateApply: return atlasaction.MigrateApply(ctx, client, action)