Files
shared-actions/.github/workflows/go-autoupdate.yaml
T
lukaszraczylo e4dac8969a chore(actions): bump shared actions to latest major versions
- actions/checkout v4 -> v6
- actions/setup-go v5 -> v6
- actions/setup-node v4 -> v6
- actions/upload-artifact v4 -> v7
- actions/download-artifact v4 -> v8
- actions/github-script v7 -> v9
- goreleaser/goreleaser-action v6 -> v7
- docker/login-action v3 -> v4
- docker/setup-buildx-action v3 -> v4
- docker/setup-qemu-action v3 -> v4
- sigstore/cosign-installer v3 -> v4
- peter-evans/create-pull-request v7 -> v8
2026-05-21 03:14:01 +01:00

86 lines
2.3 KiB
YAML

name: Go Autoupdate
on:
workflow_call:
inputs:
go-version:
description: "Go version to use"
required: false
type: string
default: ">=1.24"
release-workflow:
description: "Release workflow file to trigger (e.g., release.yml)"
required: false
type: string
default: "release.yml"
lfs:
description: "Enable Git LFS checkout (for repos with large files)"
required: false
type: boolean
default: false
jobs:
autoupdate:
name: Update dependencies and test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
lfs: ${{ inputs.lfs }}
- name: Run workflow prepare script
shell: bash
run: |
if [ -f "./workflow-prepare.sh" ]; then
chmod +x ./workflow-prepare.sh
./workflow-prepare.sh
fi
- name: Setup Go
uses: actions/setup-go@v6
with:
go-version: ${{ inputs.go-version }}
cache: true
- name: Update dependencies
run: |
go get -u ./...
go mod tidy
- name: Run tests
run: go test -race -cover ./...
- name: Check for changes
id: changes
run: |
if git diff --quiet go.mod go.sum; then
echo "changes_detected=false" >> $GITHUB_OUTPUT
else
echo "changes_detected=true" >> $GITHUB_OUTPUT
fi
- name: Create Pull Request
id: create-pr
if: steps.changes.outputs.changes_detected == 'true'
uses: peter-evans/create-pull-request@v8
with:
token: ${{ secrets.HOMEBREW_TAP_TOKEN }}
commit-message: "Update go.mod and go.sum"
title: "Update Go dependencies"
body: |
Automated dependency update.
- Updated `go.mod` and `go.sum` via `go get -u ./...`
- All tests passed
branch: auto-update-go-deps
delete-branch: true
- name: Merge PR
if: steps.create-pr.outputs.pull-request-number
run: gh pr merge --squash --delete-branch --admin "${{ steps.create-pr.outputs.pull-request-number }}"
env:
GH_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }}