Documentation
¶
Index ¶
- Constants
- Variables
- func MigrateApply(ctx context.Context, client *atlasexec.Client, act Action) error
- func MigrateDown(ctx context.Context, client *atlasexec.Client, act Action) (err error)
- func MigrateLint(ctx context.Context, client *atlasexec.Client, act Action) error
- func MigratePush(ctx context.Context, client *atlasexec.Client, act Action) error
- func MigrateTest(ctx context.Context, client *atlasexec.Client, act Action) error
- func SchemaTest(ctx context.Context, client *atlasexec.Client, act Action) error
- type Action
- type Actor
- type Logger
- type Provider
- type PullRequest
- type SCM
- type TriggerContext
Constants ¶
const ( StatePending = "PENDING_USER" StateApproved = "APPROVED" StateAborted = "ABORTED" StateApplied = "APPLIED" )
const EOF = "\n"
Line separator for logging.
Variables ¶
var Version string
Version holds atlas-action version. When built with cloud packages should be set by build flag, e.g. "-X 'ariga.io/atlas-action/atlasaction.Version=v0.1.2'"
Functions ¶
func MigrateApply ¶
MigrateApply runs the GitHub Action for "ariga/atlas-action/migrate/apply".
func MigrateDown ¶ added in v1.0.11
MigrateDown runs the GitHub Action for "ariga/atlas-action/migrate/down".
func MigrateLint ¶
MigrateLint runs the GitHub Action for "ariga/atlas-action/migrate/lint"
func MigratePush ¶
MigratePush runs the GitHub Action for "ariga/atlas-action/migrate/push"
func MigrateTest ¶ added in v1.1.3
MigrateTest runs the GitHub Action for "ariga/atlas-action/migrate/test"
Types ¶
type Action ¶ added in v1.1.0
type Action interface { Logger // GetType returns the type of atlasexec trigger Type. e.g. "GITHUB_ACTION" // The value is used to identify the type on CI-Run page in Atlas Cloud. GetType() atlasexec.TriggerType // GetInput returns the value of the input with the given name. GetInput(string) string // SetOutput sets the value of the output with the given name. SetOutput(string, string) // TriggerContext returns the context of the trigger event. GetTriggerContext() (*TriggerContext, error) // AddStepSummary adds a summary to the action step. AddStepSummary(string) }
Atlas action interface.
func NewCircleCIOrb ¶ added in v1.1.0
func NewCircleCIOrb() Action
New returns a new Action for GitHub Actions.
func NewGHAction ¶ added in v1.1.0
func NewGHAction(otps ...githubactions.Option) Action
New returns a new Action for GitHub Actions.
type Logger ¶ added in v1.1.0
type Logger interface { // Infof logs an info message. Infof(string, ...interface{}) // Warningf logs a warning message. Warningf(string, ...interface{}) // Errorf logs an error message. Errorf(string, ...interface{}) // Fatalf logs a fatal error message and exits the action. Fatalf(string, ...interface{}) // WithFieldsMap returns a new Logger with the given fields. WithFieldsMap(map[string]string) Logger }
type Provider ¶ added in v1.1.0
type Provider string
const (
ProviderGithub Provider = "GITHUB"
)
SCM Provider constants.
type PullRequest ¶ added in v1.1.0
type PullRequest struct { // Pull Request Number Number int // URL of the pull request. e.g "https://github.com/ariga/atlas-action/pull/1" URL string // Lastest commit SHA. Commit string }
PullRequest holds the pull request information.
type SCM ¶ added in v1.1.0
type SCM struct { // Type of the SCM, e.g. "GITHUB" / "GITLAB" / "BITBUCKET". Provider Provider // APIURL is the base URL for the SCM API. APIURL string }
SCM holds the source control management system information.
type TriggerContext ¶ added in v1.1.0
type TriggerContext struct { // SCM is the source control management system. SCM SCM // Repo is the repository name. e.g. "ariga/atlas-action". Repo string // RepoURL is full URL of the repository. e.g. "https://github.com/ariga/atlas-action". RepoURL string // Branch name. Branch string // Commit SHA. Commit string // PullRequest will be available if the event is "pull_request". PullRequest *PullRequest }
Context holds the context of the environment the action is running in.