Skip to content

Update App Version #163

Update App Version

Update App Version #163

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: Update App Version
# Controls when the workflow will run
on:
schedule:
- cron: '0 2 * * *'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
get-latest-app-version:
name: 'Check App Updates'
runs-on: 'ubuntu-latest'
permissions:
contents: 'write'
pull-requests: 'write'
strategy:
fail-fast: false
matrix:
include:
- name: 'faster-whisper'
repo: 'linuxserver/faster-whisper'
steps:
- uses: 'actions/checkout@v4'
with:
fetch-depth: 0
- name: 'Update AppVersion and ChartVersion'
run: |
# Set global script settings
export ALLOW_PRERELEASE='${{ matrix.allow_prerelease }}'
export STRIP_VERSION_PREFIX='${{ matrix.strip_prefix }}'
# Call main script to fetch newest app version
./scripts/update_appversion.sh \
'${{ matrix.name }}' \
'${{ matrix.repo }}' \
'${{ matrix.hub }}'
- name: 'Check for changes'
id: changes
run: |
if [[ -n "$(git status --porcelain)" ]]; then
echo "CHANGES_FOUND=true" >> $GITHUB_ENV
git diff
else
echo "CHANGES_FOUND=false" >> $GITHUB_ENV
fi
- name: 'Set up Git'
if: env.CHANGES_FOUND == 'true'
run: |
git config --global user.name "github-actions"
git config --global user.email "github-actions@users.noreply.github.com"
app_version=$(awk '/^appVersion:/ {print $2}' "./charts/${{ matrix.name }}/Chart.yaml")
BRANCH_NAME="update-${{ matrix.name }}-${app_version}"
COMMIT_MSG="New app version found for ${{ matrix.name }}"
echo "BRANCH_NAME=$BRANCH_NAME" >> "$GITHUB_ENV"
echo "COMMIT_MSG=$BRANCH_NAME" >> "$GITHUB_ENV"
- name: 'Create Pull Request'
if: env.CHANGES_FOUND == 'true'
uses: 'peter-evans/create-pull-request@v7'
with:
commit-message: ${{ env.COMMIT_MSG }}
title: "⭐️ New App Version: Update ${{ matrix.name }}"
body: 'Automated Workflow. New App Version found for Chart'
branch: ${{ env.BRANCH_NAME }}
base: ${{ github.event.repository.default_branch }}