Skip to content

Fix Tag Generation for UBI 10 #52

Fix Tag Generation for UBI 10

Fix Tag Generation for UBI 10 #52

Workflow file for this run

name: Official Images Updates
on:
workflow_dispatch:
push:
branches:
- "master"
- "8"
- "7"
- "6"
pull_request:
permissions: {}
jobs:
library-gradle:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v5
with:
fetch-depth: 0 # we need all branches so we can read Dockerfiles from them
- name: Provision best available generate-stackbrew-library.sh and toolbox
env:
EVENT_NAME: ${{ github.event_name }}
CURRENT_COMMIT: ${{ github.sha }}
BASE_REF: ${{ github.event.pull_request.base.ref }}
shell: bash
run: |
# if the generate-stackbrew-library.sh was modified in the current PR, use that version; otherwise, use the version from master
if [ "${EVENT_NAME}" == "pull_request" ] && [ "$(git diff --name-only "origin/$BASE_REF..$CURRENT_COMMIT" -- 'generate-stackbrew-library.sh' | wc -l)" -gt 0 ]; then
echo "Using modified generate-stackbrew-library.sh"
else
echo "Using generate-stackbrew-library.sh from master branch"
git checkout origin/master -- generate-stackbrew-library.sh
fi
# if the toolbox Dockerfile was modified in the current PR, use that version; otherwise, use the version from master
if [ "${EVENT_NAME}" == "pull_request" ] && [ "$(git diff --name-only "origin/$BASE_REF..$CURRENT_COMMIT" -- 'toolbox/Dockerfile' | wc -l)" -gt 0 ]; then
echo "Using modified toolbox/Dockerfile"
else
echo "Using toolbox/Dockerfile from master branch"
git checkout origin/master -- toolbox/Dockerfile
fi
- run: docker build --tag gradle-dockerhub-toolbox -f toolbox/Dockerfile toolbox
- name: Generate library file
uses: docker://gradle-dockerhub-toolbox:latest
with:
args: -c "./generate-stackbrew-library.sh ${BASE_SHA:+'--substitute' '${BASE_SHA}' '${CURRENT_COMMIT}'} > library-gradle"
env:
CURRENT_COMMIT: ${{ github.sha }}
BASE_SHA: ${{ github.event.pull_request.base.sha }}
- name: Archive library file
uses: actions/upload-artifact@v4
with:
name: gradle
path: library-gradle
- run: |
curl -q -sS -o /dev/stdout "https://raw.githubusercontent.com/docker-library/official-images/refs/heads/master/library/gradle" | \
sed -E "s/GitCommit: .*/GitCommit: 0000000000000000000000000000000000000000/" > existing-library-gradle
cat library-gradle | sed -E "s/GitCommit: .*/GitCommit: 0000000000000000000000000000000000000000/" > updated-library-gradle
- run: "diff --color existing-library-gradle updated-library-gradle || :"