-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (37 loc) · 1.11 KB
/
format-code-base.yml
File metadata and controls
45 lines (37 loc) · 1.11 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: 💅 Format Codebase
on:
push:
workflow_dispatch:
permissions: write-all
jobs:
format-codebase:
runs-on: ubuntu-latest
name: 💅 Format Codebase
steps:
- name: 📀 Checkout Repository
uses: actions/checkout@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: 🐍 Setup Python
uses: actions/setup-python@v6
with:
python-version: "3.14"
cache: "pip"
cache-dependency-path: requirements.txt
- name: 💄 Run Prettier
shell: bash
run: |
npm install -g prettier
prettier --write "**/*.{yml,json,md}"
- name: 🖤 Format code with black
shell: bash
run: |
pip install black
black . --verbose
- name: 📎 Config Git & Push Changes
shell: bash
run: |
git config --global user.email "hello@harryvasanth.com"
git config --global user.name "HarryVasanth"
git add .
git diff-index --quiet HEAD || git commit -m "chore(codebase): fmt & lint" && git push || echo "🚫 No changes" && exit