Imperia starvation fixes #166
Workflow file for this run
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
name: autoformatting-Core | |
on: | |
pull_request: | |
branches: | |
- Imperia-Core | |
types: | |
- synchronize | |
- opened | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout main repository | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{github.event.pull_request.head.ref}} | |
- name: Get the parser | |
uses: actions/checkout@v4 | |
with: | |
repository: Imperia-Development-Victoria-3/Victoria-3-dev-utilities | |
sparse-checkout: 'parser' | |
sparse-checkout-cone-mode: false | |
path: Imperia-Parser | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Install dependencies | |
run: | | |
pip install -r Imperia-Parser/parser/requirements.txt | |
- name: Run formatting script | |
run: | | |
python Imperia-Parser/parser/format.py --format_folder "." --config "Imperia-Parser/parser/config/general.yml" | |
- name: Commit and push if changes are made | |
run: | | |
git config --local user.email "${{ github.actor }}@users.noreply.github.com" | |
git config --local user.name "${{ github.actor }}" | |
git add -u | |
git diff-index --quiet HEAD || (git commit -m "Reformatted all files to common sense" && git push origin "HEAD:${{ github.head_ref }}") | |