Skip to content

Commit eec2702

Browse files
authored
Merge pull request #450 from Danil-Grigorev/dependabot-generate
🌱 Autorun make generate tasks on each dependabot PR and commit the changes to a branch
2 parents a0285da + ea87c6f commit eec2702

11 files changed

+11713
-13099
lines changed

.github/workflows/pr-dependabot.yaml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: PR dependabot code generation and go modules fix
2+
3+
# This action runs on other PRs opened by dependabot. It updates modules and generated code on PRs opened by dependabot.
4+
on:
5+
pull_request:
6+
branches:
7+
- dependabot/**
8+
push:
9+
branches:
10+
- dependabot/**
11+
workflow_dispatch:
12+
13+
permissions:
14+
contents: write # Allow to update the PR.
15+
16+
jobs:
17+
build:
18+
name: Build
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Check out code into the Go module directory
22+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # tag=v4.1.1
23+
- name: Calculate go version
24+
id: vars
25+
run: echo "go_version=$(make go-version)" >> $GITHUB_OUTPUT
26+
- name: Set up Go
27+
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # tag=v5.0.0
28+
with:
29+
go-version: ${{ steps.vars.outputs.go_version }}
30+
- uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 # tag=v4.0.1
31+
name: Restore go cache
32+
with:
33+
path: |
34+
~/.cache/go-build
35+
~/go/pkg/mod
36+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
37+
restore-keys: |
38+
${{ runner.os }}-go-
39+
- name: Update all modules
40+
run: make modules
41+
- name: Update generated code
42+
run: make generate
43+
- uses: EndBug/add-and-commit@a94899bca583c204427a224a7af87c02f9b325d5 # tag=v9.1.4
44+
name: Commit changes
45+
with:
46+
author_name: dependabot[bot]
47+
author_email: 49699333+dependabot[bot]@users.noreply.github.com
48+
default_author: github_actor
49+
message: 'Update generated code'

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ IMAGE_REVIEWERS ?= $(shell ./hack/get-project-maintainers.sh)
6666

6767
# Binaries.
6868
# Need to use abspath so we can invoke these from subdirectories
69-
CONTROLLER_GEN_VER := v0.11.4
69+
CONTROLLER_GEN_VER := v0.14.0
7070
CONTROLLER_GEN_BIN := controller-gen
7171
CONTROLLER_GEN := $(TOOLS_BIN_DIR)/$(CONTROLLER_GEN_BIN)-$(CONTROLLER_GEN_VER)
7272

@@ -548,3 +548,6 @@ test-e2e-run: $(GINKGO) $(ENVSUBST) $(HELM) ## Run e2e tests
548548
-e2e.config="$(E2E_CONF_FILE_ENVSUBST)" -e2e.components=$(RELEASE_DIR)/operator-components.yaml \
549549
-e2e.skip-resource-cleanup=$(SKIP_CLEANUP) -e2e.use-existing-cluster=$(SKIP_CREATE_MGMT_CLUSTER) \
550550
-e2e.helm-binary-path=$(HELM) -e2e.chart-path=$(CHART_PACKAGE_DIR)/cluster-api-operator-$(HELM_CHART_TAG).tgz $(E2E_ARGS)
551+
552+
go-version: ## Print the go version we use to compile our binaries and images
553+
@echo $(GO_VERSION)

api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/v1alpha2/zz_generated.deepcopy.go

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/operator.cluster.x-k8s.io_addonproviders.yaml

Lines changed: 583 additions & 656 deletions
Large diffs are not rendered by default.

config/crd/bases/operator.cluster.x-k8s.io_bootstrapproviders.yaml

Lines changed: 1166 additions & 1309 deletions
Large diffs are not rendered by default.

config/crd/bases/operator.cluster.x-k8s.io_controlplaneproviders.yaml

Lines changed: 1166 additions & 1309 deletions
Large diffs are not rendered by default.

config/crd/bases/operator.cluster.x-k8s.io_coreproviders.yaml

Lines changed: 1166 additions & 1309 deletions
Large diffs are not rendered by default.

config/crd/bases/operator.cluster.x-k8s.io_infrastructureproviders.yaml

Lines changed: 1166 additions & 1309 deletions
Large diffs are not rendered by default.

config/crd/bases/operator.cluster.x-k8s.io_ipamproviders.yaml

Lines changed: 583 additions & 656 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)