Skip to content

Official Images Updates #50

Official Images Updates

Official Images Updates #50

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
env:
EVENT_NAME: ${{ github.event_name }}
CURRENT_COMMIT: ${{ github.sha }}
BASE_REF: ${{ github.event.pull_request.base.ref }}
# if the script was modified in the current PR, use that version; otherwise, use the version from master
shell: bash
run: |
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
- name: Generate library file
uses: docker://bash:latest
with:
# See https://github.com/docker-library/bashbrew?tab=readme-ov-file#installing
args: |
-c "\
apk add --no-cache jq git curl ca-certificates && \
git config --global --add safe.directory '*' && \
curl -fsSL -o /usr/local/bin/bashbrew https://github.com/docker-library/bashbrew/releases/download/v0.1.13/bashbrew-amd64 && \
chmod +x /usr/local/bin/bashbrew && \
bashbrew --version && \
./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