Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 10 additions & 11 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
name: Enforce Maintainer Approvals

name: PR Checks and Maintainer Approvals


on:
pull_request:
types:
- opened
- synchronize
- reopened
- review_requested
- review_submitted
types: [opened, synchronize, reopened, ready_for_review]
branches:
- main

jobs:
require-approvals:
Expand All @@ -24,15 +23,15 @@ jobs:
pull_number: context.payload.pull_request.number,
});

const maintainers = ["MrImmortal09", "whilstsomebody", "0PrashantYadav0", "shuklamaneesh23", " gauravghodinde", "Robinaditya1045"];
const maintainers = ["MrImmortal09", "whilstsomebody", "0PrashantYadav0", "shuklamaneesh23", "gauravghodinde", "Robinaditya1045"];
let approvals = new Set();

reviews.forEach(review => {
if (review.state === "APPROVED" && maintainers.includes(review.user.login)) {
approvals.add(review.user.login);
if (review.state === "APPROVED" && maintainers.includes(review.user.login.trim())) {
approvals.add(review.user.login.trim());
}
});

if (approvals.size < 1) {
core.setFailed(`At least 1 maintainer approvals are required. Currently approved by: ${Array.from(approvals).join(', ')}`);
core.setFailed(`At least 1 maintainer approval is required. Currently approved by: ${Array.from(approvals).join(', ') || 'none'}`);
}
18 changes: 12 additions & 6 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,16 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: 18
cache: 'npm'
cache: 'pnpm'

- name: Install pnpm
run: npm install -g pnpm

- name: Install dependencies
run: npm ci
run: pnpm install

- name: Run ESLint
run: npm run lint
run: pnpm lint

build:
runs-on: ubuntu-latest
Expand All @@ -41,10 +44,13 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: 18
cache: 'npm'
cache: 'pnpm'

- name: Install pnpm
run: npm install -g pnpm

- name: Install dependencies
run: npm ci
run: pnpm install

- name: Build
run: npm run build
run: pnpm build
23 changes: 11 additions & 12 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,16 @@ const compat = new FlatCompat({
baseDirectory: __dirname,
});

const eslintConfig = [
...compat.extends("next/core-web-vitals", "next/typescript"),
{
ignores: [
"node_modules/**",
".next/**",
"out/**",
"build/**",
"next-env.d.ts",
],
},
];
const eslintConfig = [{
ignores: ["node_modules/**", ".next/**", "out/**", "build/**", "next-env.d.ts"]
}, ...compat.extends("next/core-web-vitals", "next/typescript"), {
ignores: [
"node_modules/**",
".next/**",
"out/**",
"build/**",
"next-env.d.ts",
],
}];

export default eslintConfig;
8 changes: 6 additions & 2 deletions hooks/useContributors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,12 @@ export default function useContributors() {
}
const data = await response.json()
setContributors(data)
} catch (err: any) {
setError(err.message)
} catch (err: unknown) {
if (err instanceof Error) {
setError(err.message)
} else {
setError(String(err))
}
} finally {
setIsLoading(false)
}
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"dev": "next dev --turbopack",
"build": "next build",
"start": "next start",
"lint": "next lint",
"lint": "eslint .",
"format": "prettier --write ."
},
"dependencies": {
Expand Down Expand Up @@ -59,7 +59,8 @@
"prettier": "^3.6.2",
"tailwindcss": "^4.1.13",
"tailwindcss-animate": "^1.0.7",
"typescript": "^5.9.2"
"typescript": "^5.9.2",
"@eslint/eslintrc": "^3"
},
"trustedDependencies": [
"@tailwindcss/oxide",
Expand Down
Loading