Skip to content

Commit

Permalink
ci: add ci task
Browse files Browse the repository at this point in the history
  • Loading branch information
sunng87 committed Dec 10, 2024
1 parent 69f10f2 commit 0423c6f
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/update-metabase.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Update Metabase Version

on:
schedule:
- cron: '0 4 * * 0'

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 }}

0 comments on commit 0423c6f

Please sign in to comment.