-
Notifications
You must be signed in to change notification settings - Fork 5
60 lines (53 loc) · 1.65 KB
/
clean-lint-style.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
51
52
53
54
55
56
57
58
59
60
name: Clean and Lint
on:
pull_request:
branches:
- main
types:
- opened
- reopened
- synchronize
- assigned
- review_requested
jobs:
clean-and-lint:
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.8'
- name: Install dependencies and run clean and lint
run: |
python -m venv venv
source venv/bin/activate
pip install --upgrade pip==24.0
pip install -r requirements-dev.txt
make clean
make clean_tt
make style
- name: Check if GPG key exists
run: |
if [ -n "${{ secrets.GPG_PRIVATE_KEY }}" ]; then
echo "GPG_KEY_EXISTS=true" >> $GITHUB_ENV
else
echo "GPG_KEY_EXISTS=false" >> $GITHUB_ENV
fi
- name: Import GPG key if it exists
if: env.GPG_KEY_EXISTS == 'true'
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
git_user_signingkey: true
git_commit_gpgsign: true
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_user_name: CleanBot
commit_message: '*** AUTOMATED COMMIT | Applied Code Formatting and Cleanup ✨🍰✨***'
commit_user_email: [email protected]
commit_options: ${{ env.GPG_KEY_EXISTS == 'true' && '-S' || '' }}
branch: ${{ github.head_ref }}