LoaderSpot/.github/workflows/update_versions.yml

41 lines
1 KiB
YAML

name: Update Version
on:
workflow_dispatch:
inputs:
datajson:
description: 'Version to update'
required: true
version:
description: 'Another version parameter'
required: true
jobs:
update-version:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v5
with:
token: ${{ secrets.PERSONAL_TOKEN }}
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: 3.12.2
- name: Update versions.json
env:
DATA_JSON: ${{ toJSON(github.event.inputs.datajson) }}
run: |
python3 update_versions.py
- name: Commit changes
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add versions.json
git commit -m "Added version ${{ github.event.inputs.version }}"
git push "https://${{ secrets.PERSONAL_TOKEN }}@github.com/${{ github.repository }}.git" HEAD:main