Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add version quote #91

Merged
merged 2 commits into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions flow/flow.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ type Flow struct {
githubAppID *int64
githubAppInstlationID *int64
githubAppPrivateKey *string
enableVersionQuote bool
}

func New(c *Config) (*Flow, error) {
Expand All @@ -32,6 +33,7 @@ func New(c *Config) (*Flow, error) {
githubAppID := os.Getenv("FLOW_GITHUB_APP_ID")
githubAppInstlationID := os.Getenv("FLOW_GITHUB_APP_INSTALLATION_ID")
githubAppPrivateKey := os.Getenv("FLOW_GITHUB_APP_PRIVATE_KEY")
f.enableVersionQuote = os.Getenv("FLOW_ENABLE_VERSION_QUOTE") == "true"

f.githubToken = &githubToken

Expand Down
3 changes: 3 additions & 0 deletions flow/process.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ func (f *Flow) process(ctx context.Context, app *Application, version string) Pu
})
release.MakeChangeFunc(ctx, client, filePath, versionRewriteRegex, func(m regexp2.Match) string {
oldVersionSet[m.GroupByName("version").String()] = nil
if f.enableVersionQuote {
return fmt.Sprintf("version: \"%s\"", version)
}
return fmt.Sprintf("version: %s", version)
})

Expand Down