Skip to content

Commit 0673fc8

Browse files
committed
fixed issue and improved CI pipline
1 parent 64f3ee1 commit 0673fc8

8 files changed

Lines changed: 545 additions & 11 deletions

File tree

.github/workflows/auto-assign.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Auto Assign Reviewer
2+
3+
on:
4+
pull_request:
5+
types: [opened, ready_for_review]
6+
7+
permissions:
8+
pull-requests: write
9+
10+
jobs:
11+
auto-assign:
12+
name: Auto Assign Reviewer
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Request Reviewer
16+
uses: actions/github-script@v7
17+
with:
18+
script: |
19+
const prAuthor = context.payload.pull_request.user.login;
20+
if (prAuthor !== 'indresh404') {
21+
try {
22+
await github.rest.pulls.requestReviewers({
23+
owner: context.repo.owner,
24+
repo: context.repo.repo,
25+
pull_number: context.issue.number,
26+
reviewers: ['indresh404']
27+
});
28+
console.log("Successfully requested review from indresh404");
29+
} catch (error) {
30+
console.log("Failed to assign reviewer: ", error.message);
31+
}
32+
} else {
33+
console.log("PR author is indresh404, skipping review request.");
34+
}

.github/workflows/ci.yml

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ on:
77
branches: [ main ]
88

99
jobs:
10-
ci:
11-
name: CI Check (Lint & Build)
10+
lint:
11+
name: Lint Check
1212
runs-on: ubuntu-latest
1313

1414
steps:
@@ -27,5 +27,42 @@ jobs:
2727
- name: Run Linter
2828
run: npm run lint
2929

30+
test:
31+
name: Unit Tests
32+
runs-on: ubuntu-latest
33+
34+
steps:
35+
- name: Checkout repository
36+
uses: actions/checkout@v4
37+
38+
- name: Set up Node.js
39+
uses: actions/setup-node@v4
40+
with:
41+
node-version: 20
42+
cache: 'npm'
43+
44+
- name: Install dependencies
45+
run: npm ci
46+
47+
- name: Run Tests
48+
run: npm run test
49+
50+
build:
51+
name: Build Application
52+
runs-on: ubuntu-latest
53+
54+
steps:
55+
- name: Checkout repository
56+
uses: actions/checkout@v4
57+
58+
- name: Set up Node.js
59+
uses: actions/setup-node@v4
60+
with:
61+
node-version: 20
62+
cache: 'npm'
63+
64+
- name: Install dependencies
65+
run: npm ci
66+
3067
- name: Build Application
3168
run: npm run build

eslint.config.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,13 @@ export default defineConfig([
1818
parserOptions: { ecmaFeatures: { jsx: true } },
1919
},
2020
rules: {
21-
'no-unused-vars': 'warn',
21+
'no-unused-vars': [
22+
'warn',
23+
{
24+
varsIgnorePattern: '^React$',
25+
argsIgnorePattern: '^_'
26+
}
27+
],
2228
'react-refresh/only-export-components': [
2329
'warn',
2430
{ allowConstantExport: true }

0 commit comments

Comments
 (0)