File tree Expand file tree Collapse file tree 2 files changed +40
-10
lines changed Expand file tree Collapse file tree 2 files changed +40
-10
lines changed Original file line number Diff line number Diff line change 1+ name : Reformat code
2+
3+ on :
4+ push :
5+ workflow_dispatch :
6+
7+ concurrency :
8+ group : ${{ github.workflow }}
9+ cancel-in-progress : false
10+
11+ jobs :
12+ format :
13+ runs-on : ubuntu-latest
14+ steps :
15+ - name : Checkout repository
16+ uses : actions/checkout@v4
17+
18+ - name : Install dependencies
19+ run : |
20+ sudo apt update
21+
22+ sudo apt install python3 black -y
23+
24+ sudo apt install nodejs npm -y
25+ sudo npm i -g prettier
26+
27+ - name : Format python using black
28+ run : black .
29+ - name : Format everything else using prettier
30+ run : prettier . -w
31+
32+ - name : Commit and push changes if any
33+ run : |
34+ if [[ `git status --porcelain` ]]; then
35+ git add .
36+ git commit --author "GitHub Actions <videocreator@outlook.de>" -m "$(echo -e "Reformat code\n\n\nCo-authored-by: $(git log "${{ github.sha }}^..${{ github.sha }}" --pretty=format:'%an <%ae>')")"
37+ git push
38+ else
39+ git status
40+ fi
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments