Skip to content

Commit ade0e61

Browse files
authored
chore: ROOT-7: "Apply Linters" github workflow to apply linters to branch (#7525)
1 parent a54daa7 commit ade0e61

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

.github/workflows/apply-linters.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Apply linters
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
branch_name:
7+
description: 'Branch name to run the workflow on'
8+
required: true
9+
type: string
10+
11+
env:
12+
NODE: "18"
13+
FRONTEND_MONOREPO_DIR: "web"
14+
15+
jobs:
16+
lint:
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v4
22+
with:
23+
token: ${{ secrets.GIT_PAT }}
24+
ref: ${{ inputs.branch_name }}
25+
26+
- name: Set up Python
27+
uses: actions/setup-python@v4
28+
with:
29+
python-version: '3.12'
30+
31+
- name: Install pre-commit
32+
run: |
33+
python -m pip install --upgrade pip
34+
pip install pre-commit
35+
36+
- name: Setup frontend environment
37+
uses: ./.github/actions/setup-frontend-environment
38+
with:
39+
node-version: "${{ env.NODE }}"
40+
directory: "${{ env.FRONTEND_MONOREPO_DIR }}"
41+
42+
- name: Run formatters
43+
run: make fmt-all || true
44+
45+
- name: Ensure no lint remains
46+
run: make fmt-all
47+
48+
- name: Commit changes
49+
run: |
50+
git config --global user.name "robot-ci-heartex"
51+
git config --global user.email "[email protected]"
52+
git add .
53+
git commit -m "Apply pre-commit linters" || echo "No changes to commit"
54+
git push

0 commit comments

Comments
 (0)