Files
atlantis/server/events/command/context.go
Rui Chen b1fb97047b links(github): replace help.github.com with docs.github.com links (#2227)
* links(github): replace help.github.com with docs.github.com links

* fix another link

Signed-off-by: Rui Chen <rui@chenrui.dev>
2022-04-29 17:35:42 -04:00

41 lines
1.1 KiB
Go

package command
import (
"github.com/runatlantis/atlantis/server/events/models"
"github.com/runatlantis/atlantis/server/logging"
"github.com/uber-go/tally"
)
// Trigger represents the how the command was triggered
type Trigger int
const (
// Commands that are automatically triggered (ie. automatic plans)
AutoTrigger Trigger = iota
// Commands that are triggered by comments (ie. atlantis plan)
CommentTrigger
)
// Context represents the context of a command that should be executed
// for a pull request.
type Context struct {
// HeadRepo is the repository that is getting merged into the BaseRepo.
// If the pull request branch is from the same repository then HeadRepo will
// be the same as BaseRepo.
// See https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/incorporating-changes-from-a-pull-request/about-pull-request-merges
HeadRepo models.Repo
Pull models.PullRequest
Scope tally.Scope
// User is the user that triggered this command.
User models.User
Log logging.SimpleLogging
// Current PR state
PullRequestStatus models.PullReqStatus
PullStatus *models.PullStatus
Trigger Trigger
}