Grasscutter/.github/workflows/lint_commit.yml
AnimeGitB 6e35625f1a Make lint workflows ignore generated folder
But run them on linter and workflow changes
2022-08-23 10:33:32 +09:30

46 lines
1.5 KiB
YAML

name: "Lint whitespace and languages"
on:
workflow_dispatch: ~
push:
paths:
- ".github/workflows/**"
- "src/main/**.java"
- "**.json"
- "build.gradle"
- "format_whitespace.py"
- "manage_languages.py"
branches:
- "development"
jobs:
Make-Lint-Commits:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Run Whitespace Linter
run: python format_whitespace.py
- run: git config --global user.name "github-actions"
- run: git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
- run: git stash
# - name: Remove Whitespace Linter's LintRatchet ref
# run: git branch -D LintRatchet
# - name: Fetch this repo's LintRatchet branch
# run: git fetch origin LintRatchet:LintRatchet
- run: git checkout LintRatchet
# - run: git merge development
- run: git reset --hard development
- run: git stash pop || true
- name: Commit any whitespace changes
run: git add -u && git commit -m 'Fix whitespace [skip actions]' || true
- name: Update Languages
run: python manage_languages.py -u
- name: Commit any language changes
run: git add -u && git commit -m 'Update languages [skip actions]' || true
- run: git push --set-upstream --force origin LintRatchet