.github/workflows/run.yml #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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-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 |