-
Notifications
You must be signed in to change notification settings - Fork 1
45 lines (34 loc) · 1.08 KB
/
Copy pathcode_analysis_pull.yml
File metadata and controls
45 lines (34 loc) · 1.08 KB
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
41
42
43
44
45
name: Code Analysis on Pull
on:
pull_request:
branches: [ main, release/** ]
jobs:
code_analysis:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: "3.10"
- name: Setup Poetry
uses: Gr1N/setup-poetry@v7
- name: Install Packages
run: poetry install
- name: Flake8 (Linter)
run: poetry run flake8
- name: isort (Import Sorter)
run: poetry run isort
- name: Black (Code Formatter)
run: find . -type f -name "*.py" | xargs poetry run black
- name: Check for changes
id: changes
uses: UnicornGlobal/has-changes-action@v1.0.11
- name: Commit and Push Changes
if: steps.changes.outputs.changed == 1
run: |
git config user.name code-analysis-action
git config user.email github-actions@github.com
git commit -a -m "Changes by Code Analysis Action" --no-verify
git push