Skip to content

Commit

Permalink
only check if commit exists in sync branches in downstream builds (Go…
Browse files Browse the repository at this point in the history
  • Loading branch information
shuyama1 authored Jul 2, 2024
1 parent f53dfd6 commit c6b1031
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions .ci/magician/cmd/generate_downstream.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,23 +97,24 @@ func execGenerateDownstream(baseBranch, command, repo, version, ref string, gh G
if baseBranch == "" {
baseBranch = "main"
}

var syncBranchPrefix string
if repo == "terraform" {
if version == "beta" {
syncBranchPrefix = "tpgb-sync"
} else if version == "ga" {
syncBranchPrefix = "tpg-sync"
if command == "downstream" {
var syncBranchPrefix string
if repo == "terraform" {
if version == "beta" {
syncBranchPrefix = "tpgb-sync"
} else if version == "ga" {
syncBranchPrefix = "tpg-sync"
}
} else if repo == "terraform-google-conversion" {
syncBranchPrefix = "tgc-sync"
} else if repo == "tf-oics" {
syncBranchPrefix = "tf-oics-sync"
}
syncBranch := getSyncBranch(syncBranchPrefix, baseBranch)
if syncBranchHasCommit(ref, syncBranch, rnr) {
fmt.Printf("Sync branch %s already has commit %s, skipping generation\n", syncBranch, ref)
os.Exit(0)
}
} else if repo == "terraform-google-conversion" {
syncBranchPrefix = "tgc-sync"
} else if repo == "tf-oics" {
syncBranchPrefix = "tf-oics-sync"
}
syncBranch := getSyncBranch(syncBranchPrefix, baseBranch)
if syncBranchHasCommit(ref, syncBranch, rnr) {
fmt.Printf("Sync branch %s already has commit %s, skipping generation\n", syncBranch, ref)
os.Exit(0)
}

mmLocalPath := filepath.Join(rnr.GetCWD(), "..", "..")
Expand Down

0 comments on commit c6b1031

Please sign in to comment.