diff --git a/.github/scripts/ciScript.js b/.github/scripts/ciScript.js index 4e4e4792..21bd910e 100644 --- a/.github/scripts/ciScript.js +++ b/.github/scripts/ciScript.js @@ -13,6 +13,7 @@ const deriveTestFiles = (files) => { }); }; + module.exports = async ({ github, context, core }) => { const owner = context.repo.owner; const repo = context.repo.repo; @@ -23,6 +24,7 @@ module.exports = async ({ github, context, core }) => { const backendFiles = []; const mobileFiles = []; const webFiles = []; + const dbFiles = []; try { if (prState === 'closed') { @@ -52,16 +54,21 @@ module.exports = async ({ github, context, core }) => { mobileFiles.push(fileName); } else if (fileName.startsWith('apps/web/')) { webFiles.push(fileName); + }else if(fileName.startsWith('apps/backend/prisma')){ + dbFiles.push(fileName) + }else if(fileName.includes('schema.prisma') || fileName.includes('/migrations/')){ + dbFiles.push(fileName) } }); const strippedBackend = backendFiles.map(f => f.replace('apps/backend/', '')); const strippedMobile = mobileFiles.map(f => f.replace('apps/mobile/', '')); - console.log({ backendFiles, mobileFiles, webFiles }); + console.log({ backendFiles, mobileFiles, webFiles, dbFiles }); core.setOutput('backendFiles', strippedBackend.join(' ')); core.setOutput('mobileFiles', strippedMobile.join(' ')); + core.setOutput('dbFiles', dbFiles.join(' ')); core.setOutput('webFiles', webFiles.map(f => f.replace('apps/web/', '')).join(' ')); core.setOutput('backendTestFiles', deriveTestFiles(strippedBackend).join(' ')); core.setOutput('mobileTestFiles', deriveTestFiles(strippedMobile).join(' ')); diff --git a/.github/scripts/discordPinReminder.js b/.github/scripts/discordPinReminder.js index d5724578..6751f7c5 100644 --- a/.github/scripts/discordPinReminder.js +++ b/.github/scripts/discordPinReminder.js @@ -3,35 +3,36 @@ module.exports = async ({ github, context }) => { const ignoreUsers = [ 'ShantKhatri', 'Harxhit', - 'blankirigaya' - ] + 'blankirigaya', + ]; + 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 (!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 to the project. - 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! +To receive the appropriate GSSoC labels and recognition, please mention @Harxhit in the **#get-labels** channel on our Discord server and share your merged PR link.`, + }); - 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}`); + console.log(`Comment added to PR #${prNumber}`); } catch (error) { - console.error(error) + console.error(error); } -}; +}; \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e8cedac7..e502a2c3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,6 +20,7 @@ jobs: webFiles: ${{ steps.detect.outputs.webFiles }} backendTestFiles: ${{ steps.detect.outputs.backendTestFiles }} mobileTestFiles: ${{ steps.detect.outputs.mobileTestFiles }} + dbFiles: ${{ steps.detect.outputs.dbFiles }} steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd @@ -55,12 +56,14 @@ jobs: with: node-version: 22 - - name: Install shared dependencies - run: npm --prefix packages/shared install - - name: Install backend dependencies run: npm --prefix apps/backend install + - name: DB migration check + if: needs.detect-changes.outputs.dbFiles != '' + continue-on-error: true + run: npm run db:migrate + - name: Backend lint id: backend_lint continue-on-error: true