From 62554a55df437e0a391ab4816668b2ca44f77a0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Kottner?= <1780890+BjoernKarma@users.noreply.github.com> Date: Fri, 12 Sep 2025 15:55:50 +0200 Subject: [PATCH 1/5] Create dependabot-tidy.yml --- .github/dependabot-tidy.yml | 79 +++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 .github/dependabot-tidy.yml diff --git a/.github/dependabot-tidy.yml b/.github/dependabot-tidy.yml new file mode 100644 index 000000000..afad65055 --- /dev/null +++ b/.github/dependabot-tidy.yml @@ -0,0 +1,79 @@ +# Copyright 2025 Deutsche Telekom IT GmbH +# +# SPDX-License-Identifier: Apache-2.0 + +name: Dependabot Tidy + +on: + pull_request: + paths: + - '**/go.mod' + - '**/go.sum' + +jobs: + tidy: + name: Run go mod tidy + if: github.actor == 'dependabot[bot]' + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + + steps: + - uses: actions/checkout@v5 + with: + ref: ${{ github.head_ref }} + fetch-depth: 0 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: 'stable' + check-latest: true + + - name: Run go mod tidy on all modules + run: | + echo "Identified modules:" + MODULES=$(find . -name 'go.mod' -exec dirname {} \; | sort) + echo "$MODULES" + echo "\nRunning go mod tidy on all modules..." + echo "$MODULES" | while read -r module_dir; do + if [ -n "$module_dir" ]; then + echo "Processing: $module_dir" + (cd "$module_dir" && go mod tidy) + fi + done + + - name: Check for changes + id: check_changes + run: | + if [[ -n "$(git status --porcelain)" ]]; then + echo "changes=true" >> $GITHUB_OUTPUT + echo "Changes detected after running go mod tidy:" + git diff --name-only + else + echo "changes=false" >> $GITHUB_OUTPUT + echo "No changes detected after running go mod tidy" + fi + + - name: Commit and push changes + if: steps.check_changes.outputs.changes == 'true' + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git add . + git commit -m "chore: run go mod tidy for modules updated by dependabot" + git push + + - name: Add comment to PR + if: steps.check_changes.outputs.changes == 'true' + uses: actions/github-script@v7 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: '✅ `go mod tidy` has been run for all Go modules and changes have been committed to this PR.' + }) From b81b84439bc61be606f94341c0def2dcaf40cad0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Kottner?= <1780890+BjoernKarma@users.noreply.github.com> Date: Fri, 12 Sep 2025 16:18:56 +0200 Subject: [PATCH 2/5] Add files via upload --- .github/workflows/dependabot-tidy.yml | 79 +++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 .github/workflows/dependabot-tidy.yml diff --git a/.github/workflows/dependabot-tidy.yml b/.github/workflows/dependabot-tidy.yml new file mode 100644 index 000000000..e1477c688 --- /dev/null +++ b/.github/workflows/dependabot-tidy.yml @@ -0,0 +1,79 @@ +# Copyright 2025 Deutsche Telekom IT GmbH +# +# SPDX-License-Identifier: Apache-2.0 + +name: Dependabot Tidy + +on: + pull_request: + paths: + - '**/go.mod' + - '**/go.sum' + +jobs: + tidy: + name: Run go mod tidy + if: github.actor == 'dependabot[bot]' + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + + steps: + - uses: actions/checkout@v5 + with: + ref: ${{ github.head_ref }} + fetch-depth: 0 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: 'stable' + check-latest: true + + - name: Run go mod tidy on all modules + run: | + echo "Identified modules:" + MODULES=$(find . -name 'go.mod' -exec dirname {} \; | sort) + echo "$MODULES" + echo "\nRunning go mod tidy on all modules..." + echo "$MODULES" | while read -r module_dir; do + if [ -n "$module_dir" ]; then + echo "Processing: $module_dir" + (cd "$module_dir" && go mod tidy) + fi + done + + - name: Check for changes + id: check_changes + run: | + if [[ -n "$(git status --porcelain)" ]]; then + echo "changes=true" >> $GITHUB_OUTPUT + echo "Changes detected after running go mod tidy:" + git diff --name-only + else + echo "changes=false" >> $GITHUB_OUTPUT + echo "No changes detected after running go mod tidy" + fi + + - name: Commit and push changes + if: steps.check_changes.outputs.changes == 'true' + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git add . + git commit -m "chore: run go mod tidy for modules updated by dependabot" + git push + + - name: Add comment to PR + if: steps.check_changes.outputs.changes == 'true' + uses: actions/github-script@v7 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: '✅ `go mod tidy` has been run for all Go modules and changes have been committed to this PR.' + }) \ No newline at end of file From 9891f516dfe76e6f7e67f4e1d95a5606587d706e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Kottner?= <1780890+BjoernKarma@users.noreply.github.com> Date: Fri, 12 Sep 2025 16:39:15 +0200 Subject: [PATCH 3/5] Update main.go fix import issue --- tools/route-tester/main.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tools/route-tester/main.go b/tools/route-tester/main.go index 35cf334d7..b5ac9a587 100644 --- a/tools/route-tester/main.go +++ b/tools/route-tester/main.go @@ -13,17 +13,18 @@ import ( "os" "github.com/pkg/errors" - applicationv1 "github.com/telekom/controlplane/application/api/v1" - "github.com/telekom/controlplane/common/pkg/util/labelutil" - gatewayv1 "github.com/telekom/controlplane/gateway/api/v1" - secretsapi "github.com/telekom/controlplane/secret-manager/api" - "github.com/telekom/controlplane/secret-manager/api/accesstoken" "golang.org/x/oauth2/clientcredentials" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/client-go/rest" "sigs.k8s.io/controller-runtime/pkg/client" kconfig "sigs.k8s.io/controller-runtime/pkg/client/config" + + applicationv1 "github.com/telekom/controlplane/application/api/v1" + accesstoken "github.com/telekom/controlplane/common-server/pkg/client/token" + "github.com/telekom/controlplane/common/pkg/util/labelutil" + gatewayv1 "github.com/telekom/controlplane/gateway/api/v1" + secretsapi "github.com/telekom/controlplane/secret-manager/api" ) var ( From 81045a51ef4402e6063ec91521b8b1c6073dffd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Kottner?= <1780890+BjoernKarma@users.noreply.github.com> Date: Mon, 15 Sep 2025 11:20:19 +0200 Subject: [PATCH 4/5] Update dependabot-tidy.yml Allow manual execution --- .github/workflows/dependabot-tidy.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dependabot-tidy.yml b/.github/workflows/dependabot-tidy.yml index e1477c688..447c4f7e2 100644 --- a/.github/workflows/dependabot-tidy.yml +++ b/.github/workflows/dependabot-tidy.yml @@ -9,11 +9,12 @@ on: paths: - '**/go.mod' - '**/go.sum' + workflow_dispatch: jobs: tidy: name: Run go mod tidy - if: github.actor == 'dependabot[bot]' + if: github.actor == 'dependabot[bot]' || github.event_name == 'workflow_dispatch' runs-on: ubuntu-latest permissions: contents: write @@ -76,4 +77,4 @@ jobs: owner: context.repo.owner, repo: context.repo.repo, body: '✅ `go mod tidy` has been run for all Go modules and changes have been committed to this PR.' - }) \ No newline at end of file + }) From 9bf0132f494d7893e024d025ed029dcf1d0c536c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 18 Sep 2025 11:04:43 +0000 Subject: [PATCH 5/5] chore(deps): Bump anchore/sbom-action from 0.20.5 to 0.20.6 Bumps [anchore/sbom-action](https://github.com/anchore/sbom-action) from 0.20.5 to 0.20.6. - [Release notes](https://github.com/anchore/sbom-action/releases) - [Changelog](https://github.com/anchore/sbom-action/blob/main/RELEASE.md) - [Commits](https://github.com/anchore/sbom-action/compare/v0.20.5...v0.20.6) --- updated-dependencies: - dependency-name: anchore/sbom-action dependency-version: 0.20.6 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 365e776fb..27f95aa85 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -39,7 +39,7 @@ jobs: ~/go/pkg/mod key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - uses: sigstore/cosign-installer@v3.9.2 - - uses: anchore/sbom-action/download-syft@v0.20.5 + - uses: anchore/sbom-action/download-syft@v0.20.6 - name: Install GoReleaser uses: goreleaser/goreleaser-action@v6 with: