-
Notifications
You must be signed in to change notification settings - Fork 153
77 lines (69 loc) · 2.43 KB
/
digester_bot.yml
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: Auto-Update Image Digests
on:
schedule:
- cron: '0 4/4 * * *'
workflow_dispatch:
jobs:
build:
name: HCO Update Image Digests Job
if: (github.repository == 'kubevirt/hyperconverged-cluster-operator')
runs-on: ubuntu-latest
steps:
- name: check for existing PR
run: |-
if curl -s -L https://api.github.com/repos/kubevirt/hyperconverged-cluster-operator/pulls | jq .[].title | grep -q "Update Image Digests"; then
echo "There is an existing PR with name 'Update Image Digests'; skipping; To run again, close the existing PR"
else
echo "NEW_PR=true" >> $GITHUB_ENV
fi
- uses: actions/checkout@v4
if: ${{ env.NEW_PR }}
with:
ref: main
- uses: actions/setup-go@v5
if: ${{ env.NEW_PR }}
with:
go-version: '1.22' # The Go version to download (if necessary) and use.
- name: Get dependencies
if: ${{ env.NEW_PR }}
working-directory: tools/digester
run: |
go get -v -t -d ./...
if [ -f Gopkg.toml ]; then
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
dep ensure
fi
- name: Build the degister app
if: ${{ env.NEW_PR }}
working-directory: tools/digester
run: go build -v .
- name: Run the degister app to update the digests
if: ${{ env.NEW_PR }}
run: |
./automation/digester/update_images.sh
if ! git diff --quiet --exit-code; then
echo "CHANGED=true" >> $GITHUB_ENV
fi
- name: Regenerage CSV
if: ${{ env.CHANGED }}
run: ./hack/build-manifests.sh
- uses: peter-evans/create-pull-request@v6
if: ${{ env.CHANGED }}
with:
token: ${{ secrets.HCO_BOT_TOKEN }}
commit-message: |
Update Image Digests
Signed-off-by: HCO Bump Bot <noreply@github.com>
committer: HCO Bump Bot <noreply@github.com>
title: "Update Image Digests"
body: |
Update Image Digests
Executed by HCO Update Image Digest Bot.
```release-note
Update Image Digests
```
assignees: tiraboschi,orenc1,nunnatsa
reviewers: tiraboschi,orenc1,nunnatsa
team-reviewers: owners, maintainers
branch: update-image-digests
delete-branch: true