generated from kubernetes/kubernetes-template-project
-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce pr-dependabot job to generate changes on bump
Signed-off-by: Danil Grigorev <[email protected]>
- Loading branch information
1 parent
006442f
commit 07aa242
Showing
2 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: PR dependabot code generation and go modules fix | ||
|
||
# This action runs on other PRs opened by dependabot. It updates modules and generated code on PRs opened by dependabot. | ||
on: | ||
pull_request: | ||
branches: | ||
- dependabot/** | ||
push: | ||
branches: | ||
- dependabot/** | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: write # Allow to update the PR. | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # tag=v4.1.1 | ||
- name: Calculate go version | ||
id: vars | ||
run: echo "go_version=$(make go-version)" >> $GITHUB_OUTPUT | ||
- name: Set up Go | ||
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # tag=v5.0.0 | ||
with: | ||
go-version: ${{ steps.vars.outputs.go_version }} | ||
- uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 # tag=v4.0.1 | ||
name: Restore go cache | ||
with: | ||
path: | | ||
~/.cache/go-build | ||
~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- name: Update all modules | ||
run: make modules | ||
- name: Update generated code | ||
run: make generate | ||
- uses: EndBug/add-and-commit@a94899bca583c204427a224a7af87c02f9b325d5 # tag=v9.1.4 | ||
name: Commit changes | ||
with: | ||
author_name: dependabot[bot] | ||
author_email: 49699333+dependabot[bot]@users.noreply.github.com | ||
default_author: github_actor | ||
message: 'Update generated code' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters