Auto-Update Image Digests #4846
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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@v3 | |
if: ${{ env.NEW_PR }} | |
with: | |
ref: main | |
- uses: actions/setup-go@v3 | |
if: ${{ env.NEW_PR }} | |
with: | |
go-version: '1.19' # 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@v3 | |
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 |