Skip to content

Commit cf054ba

Browse files
authored
Merge branch 'main' into main
2 parents b28c186 + 04f0044 commit cf054ba

75 files changed

Lines changed: 6206 additions & 1406 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/CODEOWNERS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Assign @octocat as the owner for all files
2+
* @sanjay-kv @iitzIrFan @Adez017

.github/pull_request_template.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
## Description
22

3+
<!--
34
Provide a brief summary of the changes made to the website and the motivation behind them. Include any relevant issues or tickets.
45
This helps fast tracking your PR and merge it, Check the respective box below.
5-
6+
-->
67
Fixes # (issue)
78

89
## Type of Change
@@ -16,7 +17,9 @@ Fixes # (issue)
1617

1718
## Changes Made
1819

19-
- Describe the key changes (e.g., new sections, updated components, responsive fixes).
20+
<!--
21+
Describe the key changes (e.g., new sections, updated components, responsive fixes).
22+
-->
2023

2124
## Dependencies
2225

@@ -26,6 +29,7 @@ Fixes # (issue)
2629
## Checklist
2730

2831
- [ ] My code follows the style guidelines of this project.
29-
- [ ] I have tested my changes across major browsers/devices
30-
- [ ] My changes do not generate new console warnings or errors , I ran `npm run build` and attached scrrenshot in this PR.
32+
- [ ] I have tested my changes across major browsers and devices
33+
- [ ] My changes do not generate new console warnings or errors .
34+
- [ ] I ran `npm run build` and attached screenshot(s) in this PR.
3135
- [ ] This is already assigned Issue to me, not an unassigned issue.

.github/workflows/autolabler.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Auto Label Issues and PRs
2+
3+
on:
4+
pull_request_target:
5+
types: [opened]
6+
issues:
7+
types: [opened]
8+
9+
permissions:
10+
issues: write
11+
pull-requests: write
12+
13+
jobs:
14+
add-labels:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Add labels to PR
18+
if: github.event_name == 'pull_request_target'
19+
uses: actions/github-script@v7
20+
with:
21+
script: |
22+
const prNumber = context.payload.pull_request.number;
23+
24+
await github.rest.issues.addLabels({
25+
...context.repo,
26+
issue_number: prNumber,
27+
labels: ["recode", "level 1"]
28+
});
29+
30+
console.log(`Added labels [recode, level 1] to PR #${prNumber}`);
31+
32+
- name: Add labels to Issue
33+
if: github.event_name == 'issues'
34+
uses: actions/github-script@v7
35+
with:
36+
script: |
37+
const issueNumber = context.payload.issue.number;
38+
39+
await github.rest.issues.addLabels({
40+
...context.repo,
41+
issue_number: issueNumber,
42+
labels: ["recode", "level 1"]
43+
});
44+
45+
console.log(`Added labels [recode, level 1] to Issue #${issueNumber}`);
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
name: Sync PR data from Linked Issues
2+
3+
on:
4+
pull_request_target:
5+
types: [opened, edited, synchronize]
6+
7+
jobs:
8+
sync-metadata:
9+
runs-on: ubuntu-latest
10+
11+
permissions:
12+
issues: write
13+
pull-requests: write
14+
15+
steps:
16+
- name: Extract Linked Issues
17+
id: extract
18+
uses: actions/github-script@v7
19+
with:
20+
github-token: ${{ secrets.GITHUB_TOKEN }}
21+
script: |
22+
const body = context.payload.pull_request.body || "";
23+
const issuePattern = /#(\d+)/g;
24+
let matches = [];
25+
let m;
26+
while ((m = issuePattern.exec(body)) !== null) {
27+
matches.push(parseInt(m[1]));
28+
}
29+
core.setOutput("issues", JSON.stringify(matches));
30+
31+
- name: Post or Update data Comment
32+
if: steps.extract.outputs.issues && steps.extract.outputs.issues != '[]'
33+
uses: actions/github-script@v7
34+
with:
35+
github-token: ${{ secrets.GITHUB_TOKEN }}
36+
script: |
37+
const issues = JSON.parse(`${{ steps.extract.outputs.issues }}`);
38+
const prNumber = context.payload.pull_request.number;
39+
40+
let combinedLabels = [];
41+
let combinedAssignees = [];
42+
let combinedMilestones = [];
43+
44+
for (const number of issues) {
45+
try {
46+
const issue = await github.rest.issues.get({
47+
...context.repo,
48+
issue_number: number
49+
});
50+
51+
combinedLabels.push(...issue.data.labels.map(l => l.name));
52+
combinedAssignees.push(...issue.data.assignees.map(a => a.login));
53+
if (issue.data.milestone) combinedMilestones.push(issue.data.milestone.title);
54+
55+
} catch (err) {
56+
console.log(`Could not fetch issue #${number}: ${err.message}`);
57+
}
58+
}
59+
60+
// Deduplicate
61+
combinedLabels = [...new Set(combinedLabels)];
62+
combinedAssignees = [...new Set(combinedAssignees)];
63+
combinedMilestones = [...new Set(combinedMilestones)];
64+
65+
const commentBody =
66+
`### Synced data from Linked Issues\n\n` +
67+
`**Labels:**\n${combinedLabels.length ? combinedLabels.map(l => `- ${l}`).join("\n") : "- None"}\n\n` +
68+
`**Assignees:**\n${combinedAssignees.length ? combinedAssignees.map(a => `- ${a}`).join("\n") : "- None"}\n\n` +
69+
`**Milestones:**\n${combinedMilestones.length ? combinedMilestones.map(m => `- ${m}`).join("\n") : "- None"}\n`;
70+
71+
// Get existing comments
72+
const comments = await github.rest.issues.listComments({
73+
...context.repo,
74+
issue_number: prNumber
75+
});
76+
77+
// Find existing workflow comment
78+
const existingComment = comments.data.find(c => c.body.includes("### Synced data from Linked Issues"));
79+
80+
if (existingComment) {
81+
await github.rest.issues.updateComment({
82+
...context.repo,
83+
comment_id: existingComment.id,
84+
body: commentBody
85+
});
86+
} else {
87+
// Create new comment
88+
await github.rest.issues.createComment({
89+
...context.repo,
90+
issue_number: prNumber,
91+
body: commentBody
92+
});
93+
}

Dockerfile

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,14 @@
1-
FROM node:18-alpine AS builder
1+
FROM node:20-alpine
22

3-
# Set working directory inside the container
43
WORKDIR /app
54

65
COPY package*.json ./
76

8-
# Install dependencies with legacy peer deps fix
97
RUN npm install --legacy-peer-deps
108

119
COPY . .
12-
RUN npm run build
1310

14-
# Production Image
15-
FROM node:18-alpine
16-
WORKDIR /app
17-
COPY --from=builder /app /app
11+
# No need to run 'npm run build' for development-mode Docker
1812
EXPOSE 3000
1913

20-
CMD ["npm", "run","serve"]
14+
CMD [ "npm", "run", "dev" ]

0 commit comments

Comments
 (0)