-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (40 loc) · 1.18 KB
/
autoformat-and-lint.yml
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
46
47
48
49
50
name: Autoformat and Lint
on:
pull_request:
merge_group:
jobs:
autoformat:
name: Autoformat and Lint
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: 🛎 Checkout
if: github.event.pull_request.user.login != 'dependabot[bot]'
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.WORKFLOW_COMMIT }}
- name: 🤖🛎 Bot Checkout
if: github.event.pull_request.user.login == 'dependabot[bot]'
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- name: 🐍 Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
cache: 'pip'
- name: 📦 Install dependencies
run: pip install .[dev]
- name: 🔃 Sort Imports
run: isort .
- name: 📝 Format Code
run: black .
- name: ✅ Commit code format changes
if: github.event.pull_request.user.login != 'dependabot[bot]'
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Autoformat code"
- name: 🔍 Lint
run: pylama