Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
ci: Update DataDog GitHub branch to fallback to GITHUB_REF
This was detecting branches, but not our "main" branch before.
Hopefully this fixes it!
  • Loading branch information
kylecarbs committed Feb 24, 2022
commit 48bcf2ccdc8885793252069514a92334712ac1a0
9 changes: 8 additions & 1 deletion scripts/datadog-cireport/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,16 @@ func main() {
}
commitParts := strings.Split(string(commitData), ",")

// On pull requests, this will be set!
branch := os.Getenv("GITHUB_HEAD_REF")
if branch == "" {
branch = os.Getenv("GITHUB_BASE_REF")
githubRef := os.Getenv("GITHUB_REF")
for _, prefix := range []string{"refs/heads/", "refs/tags/"} {
if !strings.HasPrefix(githubRef, prefix) {
continue
}
branch = strings.TrimPrefix(githubRef, prefix)
}
}

tags := map[string]string{
Expand Down