Documentation
¶
Overview ¶
Package cienv provides utility for environment variable in CI services.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsInGitHubAction ¶
func IsInGitHubAction() bool
IsInGitHubAction returns true if reviewdog is running in GitHub Actions.
Types ¶
type BuildInfo ¶
type BuildInfo struct {
Owner string
Repo string
SHA string
// Optional.
PullRequest int // MergeRequest for GitLab.
// Optional.
Branch string
}
BuildInfo represents build information about GitHub or GitLab project.
func GetBuildInfo ¶
GetBuildInfo returns BuildInfo from environment variables.
Supported CI services' documents: - Travis CI: https://docs.travis-ci.com/user/environment-variables/ - Circle CI: https://circleci.com/docs/environment-variables/ - Drone.io: http://docs.drone.io/environment-reference/ - GitLab CI: https://docs.gitlab.com/ee/ci/variables/#predefined-variables-environment-variables - GitLab CI doesn't export ID of Merge Request. https://gitlab.com/gitlab-org/gitlab-ce/issues/15280
type GitHubEvent ¶
type GitHubEvent struct {
PullRequest GitHubPullRequest `json:"pull_request"`
Repository struct {
Owner struct {
Login string `json:"login"`
} `json:"owner"`
Name string `json:"name"`
} `json:"repository"`
CheckSuite struct {
After string `json:"after"`
PullRequests []GitHubPullRequest `json:"pull_requests"`
} `json:"check_suite"`
HeadCommit struct {
ID string `json:"id"`
} `json:"head_commit"`
}
func LoadGitHubEvent ¶
func LoadGitHubEvent() (*GitHubEvent, error)
LoadGitHubEvent loads GitHubEvent if it's running in GitHub Actions.