Skip to content

Merge pull request #23540 from minikube-bot/auto_bump_headlamp_version #543

Merge pull request #23540 from minikube-bot/auto_bump_headlamp_version

Merge pull request #23540 from minikube-bot/auto_bump_headlamp_version #543

name: "Go Housekeeping"
on:
workflow_dispatch:
push:
branches:
- master
paths-ignore:
- 'site/**'
env:
GOPROXY: https://proxy.golang.org
GO_VERSION: '1.26.5'
permissions:
contents: read
jobs:
go-housekeeping:
if: github.repository == 'kubernetes/minikube'
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
timeout-minutes: 1
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
timeout-minutes: 2
with:
go-version: ${{env.GO_VERSION}}
cache: true
- name: Tidy Go Modules
id: gmodtidy
timeout-minutes: 2
run: make gomodtidy
- name: fmt
id: fmt
timeout-minutes: 1
run: make fmt
- name: Install goimports
timeout-minutes: 1
run: go install golang.org/x/tools/cmd/goimports@latest
- name: goimports in place
id: goimport
timeout-minutes: 1
run: make imports
- name: Git Changes
id: gitchanges
timeout-minutes: 1
run: |
c=$(git status --porcelain)
if echo "$c" | grep -qE "go.mod|go.sum"; then
echo "title=build: go mod tidy" >> "$GITHUB_OUTPUT"
else
echo "title=build: gofmt/goimports" >> "$GITHUB_OUTPUT"
fi
# The following is to support multiline with GITHUB_OUTPUT, see https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#multiline-strings
echo "changes<<EOF" >> "$GITHUB_OUTPUT"
echo "$c" >> "$GITHUB_OUTPUT"
echo "EOF" >> "$GITHUB_OUTPUT"
- name: Create PR
if: ${{ steps.gitchanges.outputs.changes != '' }}
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1
timeout-minutes: 2
with:
token: ${{ secrets.MINIKUBE_BOT_PAT }}
commit-message: Update auto-generated docs and translations
committer: minikube-bot <20374350+minikube-bot@users.noreply.github.com>
author: minikube-bot <20374350+minikube-bot@users.noreply.github.com>
branch: gomodtidy
push-to-fork: minikube-bot/minikube
base: master
delete-branch: true
title: ${{ steps.gitchanges.outputs.title }}
body: |
Committing changes resulting from
- `make gomodtidy`
- `make fmt`
- `make imports`
This PR is auto-generated by the [Go Housekeeping Job](https://github.com/kubernetes/minikube/blob/master/.github/workflows/go-housekeeping.yml) CI workflow that runs on every push to master.
```
${{ steps.gitchanges.outputs.changes }}
```