Skip to content

Commit

Permalink
cmd/main: set env var with action name (#108)
Browse files Browse the repository at this point in the history
rotemtam authored Dec 25, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 3347eaa commit 57ac4e8
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
@@ -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)

0 comments on commit 57ac4e8

Please sign in to comment.