Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Dependabot Auto Release
name: Auto Release

on:
push:
Expand Down
9 changes: 3 additions & 6 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,9 @@ jobs:
private-key: ${{ secrets.APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}

- name: Enable auto-merge for Dependabot PRs
run: gh pr merge --auto --squash "$PR_URL"
if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'}}
- name: Enable auto-merge for bot PRs
run: gh pr merge --admin --squash "$PR_URL"
if: (github.actor == 'dependabot[bot]' || github.actor == 'codereaper-automation[bot]') && github.event_name == 'pull_request'
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GH_TOKEN: ${{ steps.app-token.outputs.token }}

- name: All clear
run: exit 0
62 changes: 62 additions & 0 deletions .github/workflows/upgrade-go.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Upgrade Go Version

on:
workflow_dispatch:
schedule:
- cron: "0 8 * * 1"

jobs:
upgrade-go:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v6

- name: Create token
id: app-token
uses: actions/create-github-app-token@v2
with:
app-id: ${{ vars.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}

- name: Check for Go updates
id: check
run: |
CURRENT=$(grep "^go " go.mod | awk '{print $2}')
LATEST=$(go list -m -f '{{.Version}}' go@latest)
{
echo "latest=$LATEST"
echo "needs_update=false"
[ "$CURRENT" != "$LATEST" ] && echo "needs_update=true" || true
} >> $GITHUB_OUTPUT

- name: Update Go version
if: steps.check.outputs.needs_update == 'true'
env:
GO_VERSION: ${{ steps.check.outputs.latest }}
run: |
go mod edit -go=$GO_VERSION
go mod tidy
{
grep -v "^golang " .tool-versions || true
echo "golang $GO_VERSION"
} > .tool-versions.tmp
mv .tool-versions.tmp .tool-versions

- name: Create Pull Request
if: steps.check.outputs.needs_update == 'true'
uses: peter-evans/create-pull-request@v8
with:
author: crd-automation[bot] <crd-automation[bot]@users.noreply.github.com>
title: "chore: upgrade Go to ${{ steps.check.outputs.latest }}"
commit-message: "chore: upgrade Go to ${{ steps.check.outputs.latest }}"
branch: chore/upgrade-go-${{ steps.check.outputs.latest }}
add-paths: |
.tool-versions
go.mod
go.sum
labels: go
token: ${{ steps.app-token.outputs.token }}