Check Firefly Version #437
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
--- | |
name: Check Firefly Version | |
# yamllint disable-line rule:truthy | |
on: | |
schedule: | |
- cron: '0 0 * * *' # Run daily at 00:00 | |
workflow_dispatch: | |
jobs: | |
check_updates: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Check for new version and update Dockerfile | |
id: check_version | |
run: | | |
n_vers=$(curl --silent "https://api.github.com/repos/firefly-iii/firefly-iii/releases/latest" | jq -r .tag_name) | |
echo "new_version=$n_vers" >> $GITHUB_OUTPUT | |
echo "version is $n_vers" | |
- name: Update Dockerfile | |
run: | | |
grep "ENV FIREFLY_VERSION=" firefly-iii/Dockerfile | cut -d= -f2 | |
sed -i "s/ENV FIREFLY_VERSION=.*/ENV FIREFLY_VERSION=${{ steps.check_version.outputs.new_version }}/" firefly-iii/Dockerfile | |
- name: Check if Dockerfile has changed | |
uses: tj-actions/verify-changed-files@v20 | |
id: verify_changed_files | |
with: | |
files: | | |
firefly-iii/Dockerfile | |
- name: Create PR | |
if: steps.verify_changed_files.outputs.files_changed == 'true' | |
uses: peter-evans/create-pull-request@v7 | |
with: | |
token: ${{ secrets.DISPATCH_TOKEN }} | |
commit-message: "update firefly to version ${{ steps.check_version.outputs.new_version }}" | |
branch: "new_ff_version_${{ steps.check_version.outputs.new_version }}" | |
delete-branch: true | |
base: "main" | |
title: "Update Firefly-iii version" | |
body: "Update Firefly-iii to version ${{ steps.check_version.outputs.new_version }}" | |
labels: "enhancement" |