From 47ea0d5b214516882d1993985112a2bd0cc022a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Th=C3=B6mmes?= Date: Thu, 8 Aug 2024 17:54:46 +0200 Subject: [PATCH] Update all source versions when updating the app Currently, when an app is updated, sources that existed in the app before are **not** updated automatically. This behavior is desired to avoid an app spec change that only changes, for example the scale of a component from picking up new code. By setting the `UpdateAllSourceVersions` flag, the action now forces updates to **all** the sources of the app (either git based or image based) on the update. --- deploy/main.go | 2 +- go.mod | 2 +- go.sum | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/deploy/main.go b/deploy/main.go index 3f3a00b..27fdcca 100644 --- a/deploy/main.go +++ b/deploy/main.go @@ -120,7 +120,7 @@ func (d *deployer) deploy(ctx context.Context, spec *godo.AppSpec) (*godo.App, e } } else { d.action.Infof("app %q already exists, updating...", spec.Name) - app, _, err = d.apps.Update(ctx, app.GetID(), &godo.AppUpdateRequest{Spec: spec}) + app, _, err = d.apps.Update(ctx, app.GetID(), &godo.AppUpdateRequest{Spec: spec, UpdateAllSourceVersions: true}) if err != nil { return nil, fmt.Errorf("failed to update app: %w", err) } diff --git a/go.mod b/go.mod index 459800a..e438cde 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/digitalocean/app_action go 1.22.5 require ( - github.com/digitalocean/godo v1.119.0 + github.com/digitalocean/godo v1.119.1-0.20240808155021-0fb7950cec3c github.com/sethvargo/go-githubactions v1.2.0 github.com/stretchr/testify v1.9.0 sigs.k8s.io/yaml v1.4.0 diff --git a/go.sum b/go.sum index 1b022c0..54b7095 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,7 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/digitalocean/godo v1.119.0 h1:dmFNQwSIAcH3z+FVovHLkazKDC2uA8oOlGvg5+H4vRw= -github.com/digitalocean/godo v1.119.0/go.mod h1:WQVH83OHUy6gC4gXpEVQKtxTd4L5oCp+5OialidkPLY= +github.com/digitalocean/godo v1.119.1-0.20240808155021-0fb7950cec3c h1:qt+RbiIu2nHJHDFOwkSsE3uW6il3YUiqv0nqRXqRlLI= +github.com/digitalocean/godo v1.119.1-0.20240808155021-0fb7950cec3c/go.mod h1:WQVH83OHUy6gC4gXpEVQKtxTd4L5oCp+5OialidkPLY= github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=