Skip to content

.github/workflows/run.yml #5

.github/workflows/run.yml

.github/workflows/run.yml #5

Workflow file for this run

on:
workflow_dispatch:
inputs:
mc_version:
type: string
default: "1."
pack_format:
type: number
commit_message:
type: string
jobs:
test_job:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/setup-java@v4.0.0
with:
distribution: microsoft
java-version: 17
java-package: jdk
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: git config
run: |
git config --global user.name actions-user
git config --global user.email actions@github.com
- name: get python script
run: |
mkdir temp1
cd temp1
git init
git remote add origin https://x-access-token:${{ github.token }}@github.com/$GITHUB_REPOSITORY
git fetch origin
git reset --hard origin/main
mv blockstate_datapack_generator.py ..
mv .github/workflows/run.py ..
- name: run python script and push
run: |
mkdir temp2
cd temp2
git init
git remote add origin https://x-access-token:${{ github.token }}@github.com/$GITHUB_REPOSITORY
git fetch origin
git reset origin/datapack-preview
mv ../blockstate_datapack_generator.py .
mv ../run.py .
python blockstate_datapack_generator.py ${{ inputs.mc_version }} ${{ inputs.pack_format }}
python run.py ${{ inputs.mc_version }}
rm -f blockstate_datapack_generator.py
rm -f run.py
git add --all
git commit -m "${{ inputs.commit_message }}"
git push origin master:datapack-preview