Skip to content

Commit

Permalink
Skip commit message check if token not provided
Browse files Browse the repository at this point in the history
  • Loading branch information
jsirianni committed Nov 21, 2024
1 parent d03bb03 commit 7b12a9d
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions cmd/action/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,22 +125,26 @@ func main() {
zap.Any("bindplane_version", version.Tag),
)

// Retrieve the commit message from the head commit on the branch
message, err := commitMessage(github_url, branch, token)
if err != nil {
logger.Error("error getting commit message", zap.Error(err))
os.Exit(exitClientError)
}

// If the commit message contains `progress rollout <name>`, progress the rollout
// for the configuration instead of running the full workflow.
if name, ok := extractConfigName(message); ok {
err := action.RunRollout(name)
if token != "" {
// Retrieve the commit message from the head commit on the branch
message, err := commitMessage(github_url, branch, token)
if err != nil {
logger.Error("error progressing rollout", zap.Error(err))
logger.Error("error getting commit message", zap.Error(err))
os.Exit(exitClientError)
}
return

// If the commit message contains `progress rollout <name>`, progress the rollout
// for the configuration instead of running the full workflow.
if name, ok := extractConfigName(message); ok {
err := action.RunRollout(name)
if err != nil {
logger.Error("error progressing rollout", zap.Error(err))
os.Exit(exitClientError)
}
return
}
} else {
logger.Info("Skipping commit message check, Github token not provided")
}

// Run the full workflow
Expand Down

0 comments on commit 7b12a9d

Please sign in to comment.