-
Notifications
You must be signed in to change notification settings - Fork 97
82 lines (68 loc) · 2.08 KB
/
pr.yaml
File metadata and controls
82 lines (68 loc) · 2.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: PR Checks
on:
pull_request:
branches:
- master
- development
jobs:
pre-check:
name: PR Base Branch Check
runs-on: ubuntu-latest
steps:
- name: Check if PR targets master and is not from allowed users
run: |
AUTHOR="${{ github.actor }}"
BASE_BRANCH="${{ github.base_ref }}"
ALLOWED_USERS=("itsskofficial" "Kabeer2004")
if [[ "$BASE_BRANCH" == "master" && ! " ${ALLOWED_USERS[@]} " =~ " $AUTHOR " ]]; then
echo "PRs to master are only allowed by: ${ALLOWED_USERS[*]}"
exit 1
fi
shell: bash
security-checks:
name: Security & Secrets Scan
runs-on: ubuntu-latest
needs: pre-check
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Run GitLeaks (Secret Scanning)
uses: gitleaks/gitleaks-action@v2
with:
config-path: .github/gitleaks.toml
fail: true
- name: Run Dependabot Security Audit (JS/TS)
working-directory: src/client
run: npm audit --audit-level=high || true
linting:
name: Code Linting & Formatting
runs-on: ubuntu-latest
needs: pre-check
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install JS/TS dependencies
working-directory: src/client
run: npm ci
- name: Run ESLint (JavaScript/TypeScript)
working-directory: src/client
run: npm run lint
- name: Run Prettier Check
working-directory: src/client
run: npm run format:check
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install Python dependencies
working-directory: src/server
run: |
python -m pip install --upgrade pip
pip install ruff
- name: Run Ruff (Python Linting & Formatting)
working-directory: src/server
run: ruff check . && ruff format --check .