Skip to content

Update Go Dependencies #6

Update Go Dependencies

Update Go Dependencies #6

name: Update Go Dependencies
on:
schedule:
# Run every Monday at 9:00 AM UTC
- cron: '0 9 * * 1'
workflow_dispatch: # Allow manual trigger
permissions:
contents: write
pull-requests: write
jobs:
update-dependencies:
name: Update Go Dependencies
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@v5
with:
ref: master
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: '1.25'
- name: Update Go dependencies
run: make update-go-deps
- name: Tidy dependencies
run: make tidy
- name: Generate manifests
run: make generate manifests
- name: Format and lint fix
run: make fmt lint-fix
- name: Check for changes
id: check_changes
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "has_changes=true" >> $GITHUB_OUTPUT
else
echo "has_changes=false" >> $GITHUB_OUTPUT
fi
- name: Create Pull Request
if: steps.check_changes.outputs.has_changes == 'true'
id: create_pr
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: 'chore(deps): update Go dependencies'
title: 'chore(deps): update Go dependencies'
body: |
## Automated Go Dependencies Update
This PR updates Go module dependencies to their latest versions.
### Changes made:
- Updated Go module dependencies via `make update-go-deps`
- Regenerated manifests via `make generate manifests`
- Applied formatting and linting fixes via `make fmt lint-fix`
Please review the changes and ensure all tests pass before merging.
branch: automated/update-go-deps
delete-branch: true
labels: |
dependencies
go
automated
- name: Trigger CI workflows for generated PR
if: steps.check_changes.outputs.has_changes == 'true' && steps.create_pr.outputs.pull-request-number
run: |
curl -X POST \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
https://api.github.com/repos/${{ github.repository }}/dispatches \
-d '{
"event_type": "run-tests-for-generated-pr",
"client_payload": {
"pr_number": "${{ steps.create_pr.outputs.pull-request-number }}",
"pr_head_sha": "${{ steps.create_pr.outputs.pull-request-head-sha }}",
"pr_branch": "automated/update-go-deps",
"trigger_source": "update-go-deps"
}
}'