Skip to content

Commit

Permalink
cmd/main: set env var with action name
Browse files Browse the repository at this point in the history
  • Loading branch information
rotemtam committed Dec 25, 2023
1 parent 3347eaa commit e056977
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/atlas-action/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"context"
"errors"
"fmt"
"os"

"ariga.io/atlas-action/atlasaction"
"ariga.io/atlas-go-sdk/atlasexec"
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit e056977

Please sign in to comment.