MCPcopy Create free account
hub / github.com/bytebase/bytebase / GetJobPlatform

Function GetJobPlatform

action/world/platform.go:34–52  ·  view source on GitHub ↗

GetJobPlatform returns the platform where the job is running as a JobPlatform.

()

Source from the content-addressed store, hash-verified

32
33// GetJobPlatform returns the platform where the job is running as a JobPlatform.
34func GetJobPlatform() JobPlatform {
35 // https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables
36 if os.Getenv("GITHUB_ACTIONS") == "true" {
37 return GitHub
38 }
39 // https://docs.gitlab.com/ci/variables/predefined_variables/
40 if os.Getenv("GITLAB_CI") == "true" {
41 return GitLab
42 }
43 // https://support.atlassian.com/bitbucket-cloud/docs/variables-and-secrets/
44 if os.Getenv("BITBUCKET_BUILD_NUMBER") != "" {
45 return Bitbucket
46 }
47 // https://learn.microsoft.com/en-us/azure/devops/pipelines/release/variables?view=azure-devops
48 if os.Getenv("SYSTEM_TEAMFOUNDATIONSERVERURI") != "" {
49 return AzureDevOps
50 }
51 return LocalPlatform
52}

Callers 1

ValidateFlagsFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected