From 004cee34bf521e2c851aaf1d9317d80b9a2dceff Mon Sep 17 00:00:00 2001 From: ono-teruya <27873650+teru01@users.noreply.github.com> Date: Thu, 9 May 2024 15:46:09 +0900 Subject: [PATCH 1/2] add quote when image update --- flow/process.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flow/process.go b/flow/process.go index d9e9622..94510a9 100644 --- a/flow/process.go +++ b/flow/process.go @@ -73,7 +73,7 @@ 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) + return fmt.Sprintf("version: \"%s\"", version) }) for _, key := range app.AdditionalRewriteKeys { From 33400eb10982f77df5e92bfed918b1d63d6becda Mon Sep 17 00:00:00 2001 From: ono-teruya <27873650+teru01@users.noreply.github.com> Date: Thu, 9 May 2024 15:55:35 +0900 Subject: [PATCH 2/2] quote version --- flow/flow.go | 2 ++ flow/process.go | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/flow/flow.go b/flow/flow.go index fc0a30c..1c281f2 100644 --- a/flow/flow.go +++ b/flow/flow.go @@ -22,6 +22,7 @@ type Flow struct { githubAppID *int64 githubAppInstlationID *int64 githubAppPrivateKey *string + enableVersionQuote bool } func New(c *Config) (*Flow, error) { @@ -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 diff --git a/flow/process.go b/flow/process.go index 94510a9..64abd3d 100644 --- a/flow/process.go +++ b/flow/process.go @@ -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 {