forked from thanos-community/thanos-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (43 loc) · 1.37 KB
/
dependabot-sync.yml
File metadata and controls
50 lines (43 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: Dependabot Go Modules Sync
on:
pull_request:
paths:
- 'go.mod'
- 'go.sum'
- 'magefiles/go.mod'
- 'magefiles/go.sum'
env:
golang-version: '1.25'
jobs:
sync-modules:
# Only run on dependabot PRs (hack as there is no multimodule support in Dependabot yet
# https://github.com/dependabot/dependabot-core/issues/6678
if: github.actor == 'dependabot[bot]'
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout PR
uses: actions/checkout@v6
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Install Go
uses: actions/setup-go@v6
with:
go-version: ${{ env.golang-version }}
- name: Sync Go modules
run: make deps
- name: Check for changes
id: git-check
run: |
git diff --exit-code || echo "changes=true" >> $GITHUB_OUTPUT
- name: Commit and push if changes
if: steps.git-check.outputs.changes == 'true'
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add go.mod go.sum magefiles/go.mod magefiles/go.sum
git commit -m "chore: sync go modules across root and magefiles"
git push