Skip to content

Commit

Permalink
quote version
Browse files Browse the repository at this point in the history
  • Loading branch information
teru01 committed May 9, 2024
1 parent 004cee3 commit 33400eb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
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
5 changes: 4 additions & 1 deletion flow/process.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@ 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
return fmt.Sprintf("version: \"%s\"", version)
if f.enableVersionQuote {
return fmt.Sprintf("version: \"%s\"", version)
}
return fmt.Sprintf("version: %s", version)
})

for _, key := range app.AdditionalRewriteKeys {
Expand Down

0 comments on commit 33400eb

Please sign in to comment.