File tree Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Format and Lint
2
+
3
+ on :
4
+ push :
5
+ branches : [ main, master ]
6
+ pull_request :
7
+ branches : [ main, master ]
8
+
9
+ jobs :
10
+ format-and-lint :
11
+ runs-on : ubuntu-latest
12
+ permissions :
13
+ contents : write
14
+ steps :
15
+ - uses : actions/checkout@v4
16
+ with :
17
+ ref : ${{ github.head_ref }}
18
+
19
+ - name : Set up Python
20
+ uses : actions/setup-python@v4
21
+ with :
22
+ python-version : ' 3.11'
23
+
24
+ - name : Install dependencies
25
+ run : make install
26
+
27
+ - name : Run formatters
28
+ run : make format
29
+
30
+ - name : Run linter
31
+ run : make lint
32
+
33
+ - name : Commit and push changes if any
34
+ run : |
35
+ if [[ -n $(git status --porcelain) ]]; then
36
+ git config --local user.email "github-actions[bot]@users.noreply.github.com"
37
+ git config --local user.name "github-actions[bot]"
38
+ git add -A
39
+ git commit -m "style: format code with black and isort"
40
+ git push
41
+ else
42
+ echo "No changes to commit"
43
+ fi
You can’t perform that action at this time.
0 commit comments