Skip to content

Commit

Permalink
Merge pull request #6 from flanksource/secure-token-file
Browse files Browse the repository at this point in the history
fix: set project groupID before attempting to lookup projectID
  • Loading branch information
BrendanGalloway authored Jun 22, 2022
2 parents d9a1299 + 942f570 commit bdba1fa
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ func NewConfig(file string, tokenFile string, accessToken string, jobToken strin
}
for i := range cfg.Projects {
cfg.Projects[i].SetClient(git)
if cfg.Projects[i].GroupID == 0 {
cfg.Projects[i].GroupID = cfg.GroupID
}
id, err := cfg.Projects[i].GetID()
if err != nil {
return cfg, errors.New(fmt.Sprintf("Failed to lookup project ID: %v", err))
Expand All @@ -51,9 +54,6 @@ func NewConfig(file string, tokenFile string, accessToken string, jobToken strin
if err := cfg.Projects[i].SetToken(projectToken); err != nil {
return cfg, errors.New(fmt.Sprintf("No deployment token for %s: %s", cfg.Projects[i].Name, err))
}
if cfg.Projects[i].GroupID == 0 {
cfg.Projects[i].GroupID = cfg.GroupID
}
}
return cfg, nil
}
Expand Down

0 comments on commit bdba1fa

Please sign in to comment.