-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (32 loc) · 1008 Bytes
/
format.yml
File metadata and controls
40 lines (32 loc) · 1008 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: format py files
on:
workflow_dispatch:
permissions:
contents: write
jobs:
format:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- name: setup python (needed)
uses: actions/setup-python@v5
with:
python-version: '3.x' # latest stable
- name: install black formatter
run: pip install black
- name: format the files.
run: |
black entityx-test/dist/ba_root/mods/ --exclude '^$'
- name: fetch the changes
run: |
if [[ -n $(git status --porcelain) ]]; then
echo "files_changed=true" >> $GITHUB_ENV
fi
- name: commit the changes
if: env.files_changed == 'true'
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git commit -am "auto-formatted py files"
git push