Skip to content
Merged
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
9 changes: 8 additions & 1 deletion .github/scripts/ciScript.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const deriveTestFiles = (files) => {
});
};


module.exports = async ({ github, context, core }) => {
const owner = context.repo.owner;
const repo = context.repo.repo;
Expand All @@ -23,6 +24,7 @@ module.exports = async ({ github, context, core }) => {
const backendFiles = [];
const mobileFiles = [];
const webFiles = [];
const dbFiles = [];

try {
if (prState === 'closed') {
Expand Down Expand Up @@ -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(' '));
Expand Down
55 changes: 28 additions & 27 deletions .github/scripts/discordPinReminder.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
};
};
9 changes: 6 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down