From b9171f01358fd39cc18c62c186f8b4a55e0b5245 Mon Sep 17 00:00:00 2001 From: Harxhit Date: Sun, 24 May 2026 17:07:11 +0530 Subject: [PATCH 1/2] fix: Fixed linting issues --- apps/backend/src/app.ts | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/apps/backend/src/app.ts b/apps/backend/src/app.ts index 6a937a88..f817eb46 100644 --- a/apps/backend/src/app.ts +++ b/apps/backend/src/app.ts @@ -1,30 +1,31 @@ -import Fastify from 'fastify'; +import path from 'node:path'; +import { fileURLToPath } from 'node:url'; + +import cookie from '@fastify/cookie'; import cors from '@fastify/cors'; import helmet from '@fastify/helmet'; import jwt from '@fastify/jwt'; -import cookie from '@fastify/cookie'; import multipart from '@fastify/multipart'; -import fastifyStatic from '@fastify/static'; import rateLimit from '@fastify/rate-limit'; -import path from 'path'; -import { fileURLToPath } from 'url'; +import fastifyStatic from '@fastify/static'; +import Fastify, {type FastifyInstance} from 'fastify'; import { prismaPlugin } from './plugins/prisma.js'; import { redisPlugin } from './plugins/redis.js'; +import { analyticsRoutes } from './routes/analytics.js'; import { authRoutes } from './routes/auth.js'; -import { profileRoutes } from './routes/profiles.js'; import { cardRoutes } from './routes/cards.js'; -import { publicRoutes } from './routes/public.js'; -import { followRoutes } from './routes/follow.js'; import { connectRoutes } from './routes/connect.js'; -import { analyticsRoutes } from './routes/analytics.js'; -import { nfcRoutes } from './routes/nfc.js'; import { eventRoutes } from './routes/event.js'; +import { followRoutes } from './routes/follow.js'; +import { nfcRoutes } from './routes/nfc.js'; +import { profileRoutes } from './routes/profiles.js'; +import { publicRoutes } from './routes/public.js'; import { validateEnv } from './utils/validateEnv.js'; const __dirname = path.dirname(fileURLToPath(import.meta.url)); -export async function buildApp() { +export async function buildApp():Promise { // Validate all required secrets before registering any plugin. // If validation fails the process exits here — no partially-initialised // auth state can exist because Fastify is not yet instantiated. @@ -93,7 +94,7 @@ export async function buildApp() { app.decorate('authenticate', async function (request: any, reply: any) { try { await request.jwtVerify(); - } catch (err) { + } catch (_err) { reply.status(401).send({ error: 'Unauthorized' }); } }); From 32ce05f0a6bbc0db7585ef839125244aac928d40 Mon Sep 17 00:00:00 2001 From: Harxhit Date: Sat, 30 May 2026 13:52:03 +0530 Subject: [PATCH 2/2] feat(workflow): add merged PR discord reminder for GSSoC labels --- .github/scripts/discordPinReminder.js | 36 +++++++++++++++++++ .../workflows/gssoc-discord-pin-reminder.yml | 27 ++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 .github/scripts/discordPinReminder.js create mode 100644 .github/workflows/gssoc-discord-pin-reminder.yml diff --git a/.github/scripts/discordPinReminder.js b/.github/scripts/discordPinReminder.js new file mode 100644 index 00000000..5e4df420 --- /dev/null +++ b/.github/scripts/discordPinReminder.js @@ -0,0 +1,36 @@ +module.exports = async ({ github, context }) => { + const pr = context.payload.pull_request; + const ignoreUsers = [ + 'ShantKhatri', + 'Harxhit' + ] + try { + // Only continue if merged + if (!pr || !pr.merged) { + console.log('PR not merged.'); + return; + } + + const prNumber = pr.number; + const contributor = pr.user.login; + + if(ignoreUsers.includes(contributor)){ + console.log(`Ignoring PR #${prNumber} by ${contributor}`); + return; + } + + await github.rest.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: prNumber, + body: `Congratulations @${contributor} on getting PR #${prNumber} merged! + + Thank you for your contribution. Please mention @Harxhit in our Discord server to receive the appropriate GSSoC labels and recognition. + ` + }); + + console.log(`Comment added to PR #${prNumber}`); + } catch (error) { + console.error(error) + } +}; diff --git a/.github/workflows/gssoc-discord-pin-reminder.yml b/.github/workflows/gssoc-discord-pin-reminder.yml new file mode 100644 index 00000000..3cf2836d --- /dev/null +++ b/.github/workflows/gssoc-discord-pin-reminder.yml @@ -0,0 +1,27 @@ +name: GSSoC Discord Pin Reminder + +on: + pull_request: + types: [closed] + workflow_dispatch: + +jobs: + discord-pin-reminder: + if: github.event.pull_request.merged == true + runs-on: ubuntu-latest + + permissions: + pull-requests: write + issues: write + + steps: + - name: Checkout repository + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + + - name: Notify contributor about Discord GSSoC labels + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const script = require('./.github/scripts/discordPinReminder.js'); + await script({ github, context });