Files
protonmail-bridge/.gitea/workflows/update-protonbridge-version.yml
T
GitHub Actions 59fd1fa694
Check and Autoupdate for ProtonMail Bridge / check-update (push) Successful in 14s
Build and Push Docker Container / build-and-push (push) Successful in 4m10s
add proton bridge version check and update
2025-10-17 19:16:50 +02:00

50 lines
1.7 KiB
YAML

name: Check and Autoupdate for ProtonMail Bridge
on:
schedule:
- cron: '0 3 * * *'
workflow_dispatch:
jobs:
check-update:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Get current version from file
id: current
run: |
CURRENT_VERSION=$(cat VERSION)
echo "current_version=$CURRENT_VERSION" >> $GITHUB_OUTPUT
- name: Fetch latest ProtonMail Bridge release tag
id: latest
run: |
LATEST_VERSION=$(curl -s https://api.github.com/repos/ProtonMail/proton-bridge/releases/latest | jq -r .tag_name)
echo "latest_version=$LATEST_VERSION" >> $GITHUB_OUTPUT
- name: Compare versions
id: compare
run: |
echo "Current: ${{ steps.current.outputs.current_version }}"
echo "Latest: ${{ steps.latest.outputs.latest_version }}"
if [ "${{ steps.current.outputs.current_version }}" != "${{ steps.latest.outputs.latest_version }}" ]; then
echo "new_version=true" >> $GITHUB_OUTPUT
else
echo "new_version=false" >> $GITHUB_OUTPUT
fi
- name: Act on update
if: steps.compare.outputs.new_version == 'true'
run: |
echo "🎉 New version available: ${{ steps.latest.outputs.latest_version }}"
echo "${{ steps.latest.outputs.latest_version }}" > VERSION
# Optional: Commit and push the new version file
git config user.name "Gitea Bot"
git config user.email "actions@gitea.local"
git add VERSION
git commit -m "Update ProtonMail Bridge to ${{ steps.latest.outputs.latest_version }}"
git push