Skip to content

Get latest versions #5268

Get latest versions

Get latest versions #5268

---
name: Get latest versions
on:
workflow_dispatch:
schedule:
- cron: "0 */4 * * *"
jobs:
get-version:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 1
- name: Fetch new base versions
run: |
find ./base -maxdepth 1 -mindepth 1 -type d -exec basename {} \; | while read app; do
if test -f "./base/${app}/latest-version.sh"; then
version=$(bash "./base/${app}/latest-version.sh")
if [[ ! -z "${version}" || "${version}" != "null" ]]; then
echo "${version}" | tee "./base/${app}/VERSION" > /dev/null
echo "${app} ${version}"
fi
fi
done
- name: Fetch new app versions
id: update
run: |
find ./apps -maxdepth 1 -mindepth 1 -type d -exec basename {} \; | while read app; do
if test -f "./apps/${app}/latest-version.sh"; then
version=$(bash "./apps/${app}/latest-version.sh")
if [[ ! -z "${version}" || "${version}" != "null" ]]; then
echo "${version}" | tee "./apps/${app}/VERSION" > /dev/null
echo "${app} ${version}"
echo "app=${app}" >> $GITHUB_OUTPUT
echo "version=${version}" >> $GITHUB_OUTPUT
fi
fi
done
- name: Create pull request
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: "chore/update-${{ steps.update.outputs.app }}-${{ steps.update.outputs.version }}"
delete-branch: true
title: "Update ${{ steps.update.outputs.app }} to version ${{ steps.update.outputs.version }}"
signoff: true
committer: "${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>"
author: "${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>"
assignees: "tbouska"
commit-message: "chore: update ${{ steps.update.outputs.app }} to version ${{ steps.update.outputs.version }}"
labels: chore/update