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
3 changes: 1 addition & 2 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
* @CustomResourceDefinition/core-maintainers @CustomResourceDefinition/github-administrators
*.mod *.sum @CustomResourceDefinition/core-maintainers @CustomResourceDefinition/github-administrators @app/crd-automation
.github @CustomResourceDefinition/github-administrators @app/crd-automation
.github @CustomResourceDefinition/github-administrators
configuration.yaml @CustomResourceDefinition/core-maintainers @CustomResourceDefinition/github-administrators @CustomResourceDefinition/sources-maintainers
6 changes: 3 additions & 3 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ jobs:
- run: make test

auto-merge:
name: Automatically merge dependabot PRs
name: Automatically merge bot PRs
needs: test
runs-on: ubuntu-latest
steps:
- name: Create token
if: github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'
if: (github.actor == 'dependabot[bot]' || github.actor == 'crd-automation[bot]') && github.event_name == 'pull_request'
id: app-token
uses: actions/create-github-app-token@v2
with:
Expand All @@ -31,7 +31,7 @@ jobs:
owner: ${{ github.repository_owner }}
repositories: catalog
- name: Merge PR
if: github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'
if: (github.actor == 'dependabot[bot]' || github.actor == 'crd-automation[bot]') && github.event_name == 'pull_request'
run: gh pr merge --admin --squash "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
Expand Down
63 changes: 63 additions & 0 deletions .github/workflows/upgrade-go.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
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.AUTOMATION_APP_ID }}
private-key: ${{ secrets.AUTOMATION_APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
repositories: catalog

- 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 }}