Skip to content

Update MC version data #7903

Update MC version data

Update MC version data #7903

name: Update MC version data
on:
push:
branches:
- 'master'
paths:
- '.github/workflows/update-mc-versions.yml'
- 'update_versions.py'
schedule:
- cron: '30 * * * *'
workflow_dispatch:
jobs:
update_mc_versions:
name: "Update MC versions"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install poetry
run: pipx install poetry
- uses: actions/setup-python@v5
with:
python-version-file: '.python-version' # Read python version from .python-version
cache: 'poetry'
- run: poetry install
- run: poetry run python update_versions.py
- name: Check for changes
run: git diff --quiet version/ || echo 'CHANGED=true' >> "$GITHUB_ENV"
- name: Push changes
if: ${{ env.CHANGED == 'true' }}
run: |
git config user.name 'github-actions[bot]'
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
git add ./version/**.json
git commit -m "Update MC versions ($(date --iso-8601))"
git push