generated from kubernetes/kubernetes-template-project
-
Notifications
You must be signed in to change notification settings - Fork 560
46 lines (42 loc) · 1.58 KB
/
sync-dependabot.yaml
File metadata and controls
46 lines (42 loc) · 1.58 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
# This workflow syncs dependency versions for Dependabot PRs
name: Dependabot Version Sync
on:
pull_request_target:
branches: [ main ]
jobs:
run-sync-hugo-version:
if: ${{ contains(github.event.pull_request.labels.*.name, 'ok-to-test') && github.actor == 'dependabot[bot]' }}
runs-on: ubuntu-latest
# Permission required to edit a PR
permissions:
contents: write
steps:
- uses: actions/checkout@v6
with:
ref: ${{github.head_ref}}
- name: Set git user from last commit
run: |
git config user.name "$(git log -1 --pretty=%an)"
git config user.email "$(git log -1 --pretty=%ae)"
- name: Sync hugo version
if: ${{ contains(github.event.pull_request.title, 'hugo') }}
run: |
make sync-hugo-version
if ! git diff --exit-code; then
git add .
git commit -m "Sync hugo version"
git push
else
echo "No changes to commit"
fi
- name: Sync controller-tools version
if: ${{ contains(github.event.pull_request.title, 'sigs.k8s.io/controller-tools') }}
run: |
make manifests update-helm
if ! git diff --exit-code; then
git add .
git commit -m "Sync controller-tools version"
git push
else
echo "No changes to commit"
fi