-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
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 psav | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|