Skip to content

Commit 5bde60f

Browse files
committed
updating ci workflow
update pre quality
1 parent dfd3eef commit 5bde60f

3 files changed

Lines changed: 26 additions & 73 deletions

File tree

.github/workflows/ci-cd.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ name: CI/CD Pipeline
22

33
on:
44
push:
5-
branches: [leader, main]
5+
branches: [leader]
66
pull_request:
7-
branches: [leader, main]
7+
branches: [leader]
88

99
jobs:
1010
# 1. Fast, parallel validation for linting and unit tests
1111
unit_tests:
12-
runs-on: ubuntu-latest # 2-core runner is sufficient for fast tests
12+
runs-on: self-hosted# 2-core runner is sufficient for fast tests
1313
strategy:
1414
matrix:
1515
node-version: [18.x, 20.x]
@@ -48,7 +48,7 @@ jobs:
4848
needs: [unit_tests]
4949
# For self-hosted or larger runners, specify here:
5050
# runs-on: self-hosted-8core
51-
runs-on: ubuntu-latest # Consider upgrading this to ubuntu-latest-8-cores for speed
51+
runs-on: self-hosted # Consider upgrading this to ubuntu-latest-8-cores for speed
5252

5353
# We only need the latest, validated Node version here.
5454
steps:
@@ -113,7 +113,7 @@ jobs:
113113
114114
# 3. Security remains separate
115115
security:
116-
runs-on: ubuntu-latest
116+
runs-on: self-hosted
117117
steps:
118118
- name: Checkout code
119119
uses: actions/checkout@v4
@@ -150,4 +150,4 @@ jobs:
150150
# path: .
151151

152152
# - name: Deploy Notification
153-
# run: echo "Deployment would happen here, using the downloaded build artifact."
153+
# run: echo "Deployment would happen here, using the downloaded build artifact."

.github/workflows/pr-quality.yml

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,27 @@
11
name: PR Quality Gate
22

3+
# 🔒 SECURITY: Use manual trigger only for self-hosted runners
4+
# This prevents forks from automatically running code on your machine
35
on:
46
workflow_dispatch:
7+
inputs:
8+
branch:
9+
description: 'Branch to check'
10+
required: true
11+
default: 'main'
512

613
jobs:
714
pr-quality:
8-
runs-on: ubuntu-latest
15+
runs-on: self-hosted
916

1017
steps:
18+
- name: Cleanup Workspace
19+
run: rm -rf ./*
20+
1121
- name: Checkout code
1222
uses: actions/checkout@v4
1323
with:
24+
ref: ${{ inputs.branch }}
1425
fetch-depth: 0
1526

1627
- name: Setup Node.js
@@ -19,29 +30,26 @@ jobs:
1930
node-version: "20.x"
2031
cache: "npm"
2132

22-
- name: Install dependencies
23-
run: npm ci
33+
- name: Install dependencies (Safe Mode)
34+
# 🛡️ SECURITY: --ignore-scripts prevents malicious postinstall scripts
35+
# from executing on your local machine.
36+
run: npm ci --ignore-scripts
2437

25-
- name: Check PR title format
26-
run: |
27-
# This check is informational for manual runs.
28-
# In a real PR context, you would use github.event.pull_request.title
29-
echo "Note: This check is for a manual run. In a PR, it would validate the title."
30-
3138
- name: Check for large files
3239
run: |
40+
echo "🔍 Scanning for large files (>1MB)..."
3341
find . -type f -size +1M -not -path "./node_modules/*" -not -path "./.git/*" | while read file; do
3442
echo "::warning::Large file detected: $file ($(du -h "$file" | cut -f1))"
3543
done
3644
3745
- name: Lint commit messages
3846
run: |
39-
echo "Note: This check is for a manual run. In a PR, it would lint commit messages."
47+
echo "🔍 Verifying Conventional Commits..."
4048
if git rev-parse --verify HEAD~1 >/dev/null 2>&1; then
4149
git log --oneline HEAD~1..HEAD | while read line; do
4250
if [[ ! "$line" =~ ^[a-f0-9]+\ (feat|fix|docs|style|refactor|test|chore|perf|ci)(\(.+\))?: ]]; then
43-
echo "::warning::Commit message should follow conventional commits: $line"
51+
echo "::warning::Invalid Commit Message: $line"
52+
echo "::warning::Format should be: type(scope): description"
4453
fi
4554
done
4655
fi
47-

.github/workflows/security-scan.yml

Lines changed: 0 additions & 55 deletions
This file was deleted.

0 commit comments

Comments
 (0)