Skip to content

Update Metabase Version #1

Update Metabase Version

Update Metabase Version #1

name: Update Metabase Version
on:
schedule:
- cron: '0 4 * * 0'
workflow_dispatch:
jobs:
update_metabase:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install requests
- name: Get latest Metabase release version
id: get_version
run: |
LATEST_RELEASE=$(curl -s https://api.github.com/repos/metabase/metabase/releases/latest | jq -r .tag_name)
echo "::set-output name=version::$LATEST_RELEASE"
- name: Run update_files.py
run: |
python update-version.py ${{ steps.get_version.outputs.version }}
- name: Check if workspace is dirty
id: check_dirty
run: |
if [[ -n $(git status --porcelain) ]]; then
echo "::set-output name=is_dirty::true"
else
echo "::set-output name=is_dirty::false"
fi
- name: Create pull request if workspace is dirty
if: steps.check_dirty.outputs.is_dirty == 'true'
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.PAT }}
commit-message: "Update Metabase to ${{ steps.get_version.outputs.version }}"
title: "Update Metabase to ${{ steps.get_version.outputs.version }}"
body: "This PR updates the Metabase version to ${{ steps.get_version.outputs.version }}."
branch: update-metabase-${{ steps.get_version.outputs.version }}