From b094264c8da5465efc03f92656a627ffb839b391 Mon Sep 17 00:00:00 2001 From: "cory.murphy" Date: Wed, 16 Oct 2024 10:03:05 -0400 Subject: [PATCH] ensure that the app resolver returns unique values --- charts/argobot/Chart.yaml | 4 ++-- pkg/events/application_resolver.go | 3 ++- version | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/charts/argobot/Chart.yaml b/charts/argobot/Chart.yaml index 0ccadfd..15c37fe 100644 --- a/charts/argobot/Chart.yaml +++ b/charts/argobot/Chart.yaml @@ -2,5 +2,5 @@ apiVersion: v2 name: argobot description: Helm chart for the corymurphy/argobot app type: application -version: 0.16.3 -appVersion: 0.16.3 +version: 0.16.4 +appVersion: 0.16.4 diff --git a/pkg/events/application_resolver.go b/pkg/events/application_resolver.go index 6e8e6de..b71e9c8 100644 --- a/pkg/events/application_resolver.go +++ b/pkg/events/application_resolver.go @@ -9,6 +9,7 @@ import ( "github.com/corymurphy/argobot/pkg/argocd" "github.com/corymurphy/argobot/pkg/github" "github.com/corymurphy/argobot/pkg/logging" + "github.com/corymurphy/argobot/pkg/utils" gogithub "github.com/google/go-github/v53/github" ) @@ -46,7 +47,7 @@ func (a *ApplicationResolver) FindApplicationNames(ctx context.Context, event gi a.Log.Debug(fmt.Sprintf("name: %s | path: %s", name, path)) for _, file := range modified { - if strings.Contains(file, path) && app.Spec.Source.RepoURL == event.Repository.HtmlUrl() { + if !utils.StringInSlice(name, changedApps) && strings.Contains(file, path) && app.Spec.Source.RepoURL == event.Repository.HtmlUrl() { changedApps = append(changedApps, name) } } diff --git a/version b/version index 7eb3095..5f2491c 100644 --- a/version +++ b/version @@ -1 +1 @@ -0.16.3 +0.16.4