-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading status checks…
chore: Simplify CI implementations
- 1.0.1-20250116172941-g4423156-12814337605-1
- 1.0.0
- 1.0.0-20250116172524-gebe362d-12814265732-1
- 1.0.0-20250116165940-g0877691-12813818987-1
- 1.0.0-20250116162003-gccf62f9-12813121559-1
- 1.0.0-20250116161039-g548a4de-12812949964-1
- 1.0.0-20250116155819-g0c11e7a-12812707819-1
- 1.0.0-20250116155805-g434b242-12812703719-1
- 1.0.0-20250116155531-g9040a35-12812662140-1
- 1.0.0-20250116155507-ge61e6bf-12812653965-1
- 1.0.0-20250112070323-g8ce9be0-12731373021-1
- 1.0.0-20250111151248-g13cf974-12725317795-1
- 1.0.0-20250102151634-g8186df1-12584571412-1
- 1.0.0-20250102151431-g5701d69-12584541925-1
- 1.0.0-20250102151022-g5d7c6ff-12584484317-1
- 1.0.0-20250102141131-g39d0b59-12583705231-1
- 1.0.0-20241222205231-g9ac7729-12457587744-1
- 1.0.0-20241207143310-g1356f07-12213692646-1
- 1.0.0-20241127214906-g1f8292a-12058740483-1
- 1.0.0-20241127195758-g348f464-12057405114-1
- 1.0.0-20241127083901-g5f5387d-12046609748-1
- 1.0.0-20241126232437-ga37162f-12040716972-1
- 1.0.0-20241122235700-g39113d9-11981982427-1
- 1.0.0-20241108082739-ge2e3d96-11738646894-1
- 1.0.0-20241028022908-g260b811-11546230380-1
- 1.0.0-20241027024918-gb666d4e-11536991385-1
- 1.0.0-20241006053746-g6eba0f6-11199330460-1
- 1.0.0-20241004053507-g73a85b1-11174590308-1
- 1.0.0-20241002051638-gdc25b98-11138242823-1
- 1.0.0-20240929080927-gf3d6823-11090995117-1
- 1.0.0-20240914143624-ge9c29c2-10863233842-1
- 1.0.0-20240829053722-g44ba069-10609351695-1
- 1.0.0-20240824025924-ga16f824-10535174307-1
- 1.0.0-20240816053621-gd00bef9-10415231891-1
- 1.0.0-20240815204902-gc9a45db-10410345672-1
- 1.0.0-20240810085948-g5bef34a-10330430871-1
- 1.0.0-20240802202644-g5da086a-10221630910-1
- 1.0.0-20240727114238-gbcca318-10123244331-1
- 1.0.0-20240724235418-g458d1e5-10085680924-1
- 1.0.0-20240704115732-gf30ab0a-9793870945-1
- 1.0.0-20240629024432-g4c57b25-9720991314-1
- 1.0.0-20240621205838-g6517a4c-9619715913-1
- 1.0.0-20240617045810-g45b71f6-9542174782-1
- 1.0.0-20240616020102-gca9a379-9532508075-1
- 1.0.0-20240601051243-ge121a6f-9327828053-1
- 1.0.0-20240601015603-gf215a35-9326663187-1
- 1.0.0-20240531230043-g26f3e8d-9325308289-1
- 1.0.0-20240531225803-gb05306e-9325290524-1
- 1.0.0-20240531225509-g55f9818-9325274983-1
- 1.0.0-20240531224732-g278473b-9325225780-1
- 1.0.0-20240531214710-g54718d3-9324710891-1
- 1.0.0-20240531191447-g66a9bf7-9323200492-1
- 1.0.0-20240531163141-ga52e167-9321354411-1
- 1.0.0-20240531131948-gb624905-9318848175-1
- 1.0.0-20240531130512-gfa6eb7c-9318646079-1
- 1.0.0-20240530131756-g832f9cc-9303249078-1
- 1.0.0-20240530130850-gf000a44-9303113894-1
- 1.0.0-20240530125325-gd18d35f-9302872029-1
- 1.0.0-20240530090312-g28858b5-9299897783-1
- 1.0.0-20240529222136-g00e01ee-9293883149-1
- 1.0.0-20240529221906-gdabb2d0-9293856218-1
- 1.0.0-20240529221319-gcf4dd11-9293800689-1
- 1.0.0-20240529215926-gf7cab6c-9293654738-1
- 1.0.0-20240529215144-gc70154a-9293590172-1
- 1.0.0-20240529210751-ge819745-9293129788-1
- 1.0.0-20240528143047-gd80b8d2-9271269072-1
- 1.0.0-20240528142950-g2eb7ec9-9271253029-1
- 1.0.0-20240528142850-g692d6bc-9271235990-1
- 1.0.0-20240527134148-g1b2c37c-9255875494
- 1.0.0-20240527113258-g9596270-9254099923
- 1.0.0-20240527111721-geb9f32c-9253911217
- 1.0.0-20240527102327-g13866bd-9253259568
- 1.0.0-20240525215722-g622733a-9238456742
- 1.0.0-20240525214939-ga9902a8-9238426708
- 1.0.0-20240525203656-g3b73318-9238074040
- 1.0.0-20240525151439-g4e5511a-9236393443
1 parent
4c79ae7
commit f73b431
Showing
6 changed files
with
46 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
trunkver |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,10 @@ | ||
package ci | ||
|
||
import ( | ||
"os" | ||
) | ||
|
||
type Circleci struct{} | ||
|
||
func (g *Circleci) IsInUse() bool { | ||
return os.Getenv("CIRCLECI") == "true" | ||
} | ||
|
||
func (g *Circleci) Get() CIData { | ||
return CIData{ | ||
SourceRef: "g" + os.Getenv("CIRCLE_SHA1")[:7], | ||
BuildRef: os.Getenv("CIRCLE_WORKFLOW_JOB_ID"), | ||
} | ||
} | ||
|
||
func init() { | ||
RegisterCi(&Circleci{}) | ||
RegisterCi(&SimpleEnvBased{ | ||
Name: "CircleCI", | ||
DetectKey: "CIRCLECI", | ||
SourceRefKey: "CIRCLE_SHA1", | ||
BuildRefKey: "CIRCLE_WORKFLOW_JOB_ID", | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,10 @@ | ||
package ci | ||
|
||
import ( | ||
"os" | ||
) | ||
|
||
type Github struct{} | ||
|
||
func (g *Github) IsInUse() bool { | ||
return os.Getenv("GITHUB_SHA") != "" && os.Getenv("GITHUB_RUN_ID") != "" | ||
} | ||
|
||
func (g *Github) Get() CIData { | ||
return CIData{ | ||
SourceRef: "g" + os.Getenv("GITHUB_SHA")[:7], | ||
BuildRef: os.Getenv("GITHUB_RUN_ID"), | ||
} | ||
} | ||
|
||
func init() { | ||
RegisterCi(&Github{}) | ||
RegisterCi(&SimpleEnvBased{ | ||
Name: "Github", | ||
DetectKey: "GITHUB_SHA", | ||
SourceRefKey: "GITHUB_SHA", | ||
BuildRefKey: "GITHUB_RUN_ID", | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,10 @@ | ||
package ci | ||
|
||
import ( | ||
"os" | ||
) | ||
|
||
type Gitlab struct{} | ||
|
||
func (g *Gitlab) IsInUse() bool { | ||
return os.Getenv("GITLAB_CI") == "true" | ||
} | ||
|
||
func (g *Gitlab) Get() CIData { | ||
return CIData{ | ||
SourceRef: "g" + os.Getenv("CI_COMMIT_SHA")[:7], | ||
BuildRef: os.Getenv("CI_JOB_ID"), | ||
} | ||
} | ||
|
||
func init() { | ||
RegisterCi(&Gitlab{}) | ||
RegisterCi(&SimpleEnvBased{ | ||
Name: "Gitlab", | ||
DetectKey: "GITLAB_CI", | ||
SourceRefKey: "CI_COMMIT_SHA", | ||
BuildRefKey: "CI_JOB_ID", | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package ci | ||
|
||
import "os" | ||
|
||
type SimpleEnvBased struct { | ||
Name string | ||
DetectKey string | ||
SourceRefKey string | ||
BuildRefKey string | ||
} | ||
|
||
func (g *SimpleEnvBased) IsInUse() bool { | ||
return os.Getenv(g.DetectKey) != "" | ||
} | ||
|
||
func (g *SimpleEnvBased) Get() CIData { | ||
return CIData{ | ||
SourceRef: "g" + os.Getenv(g.SourceRefKey)[:7], | ||
BuildRef: os.Getenv(g.BuildRefKey), | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters