Regular base image update check #109
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: Regular base image update check | |
on: | |
schedule: | |
- cron: "5 0 * * *" | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install skopeo | |
run: sudo apt-get install -y skopeo | |
- name: Check change | |
run: | | |
skopeo inspect "docker://registry.access.redhat.com/ubi9/ubi:latest" | grep -Po '(?<="Digest": ")([^"]+)' > .baseimagedigest | |
docker run --rm --entrypoint sh -u 0 quay.io/urbanos/ubi-trino:latest -c \ | |
'yum upgrade -y --security > /dev/null; rpm -qa | sort | sha256sum' \ | |
>> .baseimagedigest | |
- name: Do change if the digest changed | |
run: | | |
git config user.name 'Update-a-Bot' | |
git config user.email '[email protected]' | |
git add .baseimagedigest | |
if [ $(git status --porcelain | wc -l) -eq "0" ]; then echo "No new changes"; else ./bump-image-tag.sh; fi | |
git commit -m "chore(image): update and rebuild image" || echo "No new changes" | |
- name: Create pull request | |
uses: peter-evans/create-pull-request@v6 | |
with: | |
title: 'chore(image): update base image' | |
reviewers: 'ian-j-abbott-accenture' |