Skip to content

Commit

Permalink
Add image updater GH action
Browse files Browse the repository at this point in the history
  • Loading branch information
gburges committed Oct 25, 2023
1 parent 6cc1222 commit eb5e4a9
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/imageupdate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Base image auto update
on:
schedule:
- cron: "5 0 * * *"
workflow_dispatch:

jobs:
checkout:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up skopeo
run: sudo apt-get install -y skopeo
- name: Check ubi8-minimal change
run: |
ubiversion=$(skopeo inspect docker://registry.access.redhat.com/ubi8/ubi-minimal:latest |jq '.Labels.url' |sed 's/"//g' |awk -F/ '{print $NF}')
- name: Check go-toolset change
run: |
gotoolsetver=$(skopeo inspect docker://registry.access.redhat.com/ubi8/go-toolset:latest |jq '.Labels.url' |sed 's/"//g' |awk -F/ '{print $NF}')
- name: Do change if the version changed
run: |
git config user.name 'Update-a-Bot'
git config user.email 'webdev-spam-list <webdev-spam-list@redhat.com>'
sed -i "s/registry.access.redhat.com\/ubi8\/ubi-minimal:[0-9.-]*/registry.access.redhat.com\/ubi8\/ubi-minimal:$ubiversion/" Dockerfile
sed -i "s/registry.access.redhat.com\/ubi8\/go-toolset:[0-9.-]*/registry.access.redhat.com\/ubi8\/ubi-minimal:$gotoolsetver/" Dockerfile.base
git add -A
git commit -m "Update to ubi-minimal or go-toolset image" || echo "No changes to commit"
- name: Create pull request
run: gh pr create --title 'Regular docker image update' --body 'Automation \o/' --reviewer maknop

0 comments on commit eb5e4a9

Please sign in to comment.