Skip to content

Commit 11d551e

Browse files
authored
Merge branch 'CodeHarborHub:main' into maximum-product-subarray
2 parents 0b0656e + f4de1eb commit 11d551e

File tree

2,433 files changed

+277268
-10636
lines changed

Some content is hidden

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

2,433 files changed

+277268
-10636
lines changed

.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ BASE_URL =
22
ALGOLIA_API_KEY =
33
ALGOLIA_APP_ID =
44
GTM_ID =
5-
GA_ID =
5+
GA_ID =

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
contact_links:
2+
- name: CodeHarborHub Q&A
3+
url: https://codeharborhub.github.io/community/supports#-how-to-get-support
4+
about: Get help from the community with any questions or issues.
5+
6+
- name: CodeHarborHub Features
7+
url: https://codeharborhub.github.io/community/features
8+
about: Explore the features and capabilities of CodeHarborHub.
9+
10+
- name: Meet the Founder or Owner
11+
url: https://codeharborhub.github.io/me/
12+
about: Learn more about the founder and owner of CodeHarborHub.

.github/dependabot.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "npm" # Using npm for Docusaurus
9+
directory: "/"
10+
schedule:
11+
interval: "daily" # Changed to daily from weekly
12+
# open-pull-requests-limit: 0 # Disable version updates for npm dependencies
13+
labels:
14+
- 'pr: dependencies'
15+
16+
- package-ecosystem: "github-actions"
17+
directory: "/"
18+
schedule:
19+
interval: "weekly"
20+
open-pull-requests-limit: 99
21+
labels:
22+
- 'pr: dependencies'
23+
24+
- package-ecosystem: "docker"
25+
directory: "/"
26+
schedule:
27+
interval: "weekly"
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Auto Content on Labels
2+
3+
on:
4+
issues:
5+
types: [opened]
6+
pull_request:
7+
types: [opened]
8+
9+
jobs:
10+
addContent:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Check for Labels
14+
id: check_labels
15+
run: echo "::set-output name=labels::${{ toJson(github.event.issue.labels) }}"
16+
17+
- name: Add Guidance Comment
18+
if: ${{ contains(steps.check_labels.outputs.labels, 'dsa-solution') }}
19+
uses: actions/github-script@v7
20+
with:
21+
github-token: ${{ secrets.GITHUB_TOKEN }}
22+
script: |
23+
const issueOrPR = github.context.payload.issue || github.context.payload.pull_request;
24+
const comment = `
25+
Hello there! 🌟 It looks like you've added the \`dsa-solution\` label.
26+
Please refer to our guidance on Data Structures & Algorithms solutions here: [DSA Solution Guidance](https://github.com/orgs/CodeHarborHub/discussions/3369#discussion-6940372).
27+
Thank you!
28+
`;
29+
github.issues.createComment({
30+
issue_number: issueOrPR.number,
31+
owner: github.context.repo.owner,
32+
repo: github.context.repo.repo,
33+
body: comment
34+
});
Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
1-
name: Comment on Issue Close
2-
3-
on:
4-
issues:
5-
types: [closed]
6-
7-
jobs:
8-
greet-on-close:
9-
runs-on: ubuntu-latest
10-
permissions:
11-
issues: write
12-
steps:
13-
- name: Greet User
14-
uses: actions/github-script@v7
15-
with:
16-
github-token: ${{ secrets.GITHUB_TOKEN }}
17-
script: |
18-
const issue = context.payload.issue;
19-
const issueCreator = issue.user.login;
20-
const issueNumber = issue.number;
21-
22-
const greetingMessage = `Hello @${issueCreator}! Your issue #${issueNumber} has been closed. Thank you for your contribution!`;
23-
24-
github.rest.issues.createComment({
25-
owner: context.repo.owner,
26-
repo: context.repo.repo,
27-
issue_number: issueNumber,
28-
body: greetingMessage
1+
name: Comment on Issue Close
2+
3+
on:
4+
issues:
5+
types: [closed]
6+
7+
jobs:
8+
greet-on-close:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
issues: write
12+
steps:
13+
- name: Greet User
14+
uses: actions/github-script@v7
15+
with:
16+
github-token: ${{ secrets.GITHUB_TOKEN }}
17+
script: |
18+
const issue = context.payload.issue;
19+
const issueCreator = issue.user.login;
20+
const issueNumber = issue.number;
21+
22+
const greetingMessage = `Hello @${issueCreator}! Your issue #${issueNumber} has been closed. Thank you for your contribution!`;
23+
24+
github.rest.issues.createComment({
25+
owner: context.repo.owner,
26+
repo: context.repo.repo,
27+
issue_number: issueNumber,
28+
body: greetingMessage
2929
});

.github/workflows/close-old-issue.yml

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,37 @@
1-
name: Close Old Issues
2-
on:
3-
schedule:
4-
- cron: "0 0 * * *"
5-
6-
jobs:
7-
close-issues:
8-
runs-on: ubuntu-latest
9-
10-
steps:
11-
- name: Checkout Repository
12-
uses: actions/checkout@v4
13-
14-
- name: Close Old Issues
15-
run: |
16-
open_issues=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
17-
"https://api.github.com/repos/${{ github.repository }}/issues?state=open" \
18-
| jq -r '.[] | .number')
19-
for issue in $open_issues; do
20-
# Get the last updated timestamp of the issue
21-
last_updated=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
22-
"https://api.github.com/repos/${{ github.repository }}/issues/$issue" \
23-
| jq -r '.updated_at')
24-
days_since_update=$(( ( $(date +%s) - $(date -d "$last_updated" +%s) ) / 86400 ))
25-
if [ $days_since_update -gt 30 ]; then
26-
curl -s -X PATCH -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
27-
-H "Accept: application/vnd.github.v3+json" \
28-
-d '{"state":"closed"}' \
29-
"https://api.github.com/repos/${{ github.repository }}/issues/$issue"
30-
31-
# Add a comment explaining when the issue will be closed
32-
curl -s -X POST -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
33-
-H "Accept: application/vnd.github.v3+json" \
34-
-d '{"body":"This issue has been automatically closed because it has been inactive for more than 30 days. If you believe this is still relevant, feel free to reopen it or create a new one. Thank you!"}' \
35-
"https://api.github.com/repos/${{ github.repository }}/issues/$issue/comments"
36-
fi
1+
name: Close Old Issues
2+
on:
3+
schedule:
4+
- cron: "0 0 * * *"
5+
6+
jobs:
7+
close-issues:
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- name: Checkout Repository
12+
uses: actions/checkout@v4
13+
14+
- name: Close Old Issues
15+
run: |
16+
open_issues=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
17+
"https://api.github.com/repos/${{ github.repository }}/issues?state=open" \
18+
| jq -r '.[] | .number')
19+
for issue in $open_issues; do
20+
# Get the last updated timestamp of the issue
21+
last_updated=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
22+
"https://api.github.com/repos/${{ github.repository }}/issues/$issue" \
23+
| jq -r '.updated_at')
24+
days_since_update=$(( ( $(date +%s) - $(date -d "$last_updated" +%s) ) / 86400 ))
25+
if [ $days_since_update -gt 30 ]; then
26+
curl -s -X PATCH -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
27+
-H "Accept: application/vnd.github.v3+json" \
28+
-d '{"state":"closed"}' \
29+
"https://api.github.com/repos/${{ github.repository }}/issues/$issue"
30+
31+
# Add a comment explaining when the issue will be closed
32+
curl -s -X POST -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
33+
-H "Accept: application/vnd.github.v3+json" \
34+
-d '{"body":"This issue has been automatically closed because it has been inactive for more than 30 days. If you believe this is still relevant, feel free to reopen it or create a new one. Thank you!"}' \
35+
"https://api.github.com/repos/${{ github.repository }}/issues/$issue/comments"
36+
fi
3737
done

.github/workflows/close-old-pr.yml

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
1-
name: Close Stale PRs
2-
3-
on:
4-
schedule:
5-
- cron: '0 0 * * *' # Runs daily at midnight
6-
pull_request:
7-
types:
8-
- opened
9-
- reopened
10-
- synchronize
11-
12-
permissions:
13-
pull-requests: write
14-
issues: write
15-
16-
jobs:
17-
close_stale_prs:
18-
runs-on: ubuntu-latest
19-
permissions:
20-
pull-requests: write
21-
22-
steps:
23-
- uses: actions/stale@v9
24-
with:
25-
repo-token: ${{ secrets.GITHUB_TOKEN }}
26-
stale-pr-message: 'This PR has been automatically closed due to inactivity from the owner for 15 days.'
27-
days-before-pr-stale: 15
28-
days-before-pr-close: 0
29-
exempt-pr-author: false
30-
exempt-pr-labels: ''
31-
only-labels: ''
32-
operations-per-run: 30
33-
remove-stale-when-updated: true
1+
name: Close Stale PRs
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 * * *' # Runs daily at midnight
6+
pull_request:
7+
types:
8+
- opened
9+
- reopened
10+
- synchronize
11+
12+
permissions:
13+
pull-requests: write
14+
issues: write
15+
16+
jobs:
17+
close_stale_prs:
18+
runs-on: ubuntu-latest
19+
permissions:
20+
pull-requests: write
21+
22+
steps:
23+
- uses: actions/stale@v9
24+
with:
25+
repo-token: ${{ secrets.GITHUB_TOKEN }}
26+
stale-pr-message: 'This PR has been automatically closed due to inactivity from the owner for 15 days.'
27+
days-before-pr-stale: 15
28+
days-before-pr-close: 0
29+
exempt-pr-author: false
30+
exempt-pr-labels: ''
31+
only-labels: ''
32+
operations-per-run: 30
33+
remove-stale-when-updated: true
3434
debug-only: false

.github/workflows/codacy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040

4141
# Execute Codacy Analysis CLI and generate a SARIF output with the security issues identified during the analysis
4242
- name: Run Codacy Analysis CLI
43-
uses: codacy/codacy-analysis-cli-action@740bfaa8ff39510e8b8049e711ac5c801d194199
43+
uses: codacy/codacy-analysis-cli-action@09916000460adeeedc96b9704f86deba53e2ad5d
4444
with:
4545
# Check https://github.com/codacy/codacy-analysis-cli#project-token to get your project token from your Codacy repository
4646
# You can also omit the token and run the tools that support default configurations

.github/workflows/greetings.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ jobs:
2424
with:
2525
repo-token: ${{ secrets.GITHUB_TOKEN }}
2626
issue-message: |
27-
Hi there! 👋 Thank you for opening your issue on CodeHarborHub. We're excited to hear your thoughts and help you out. You've raised a great topic! Please provide as much detail as you can so we can assist you effectively. Welcome aboard!
27+
Hi @${{ github.actor }}! 👋 Thank you for opening your first issue on CodeHarborHub. We're excited to hear your thoughts and help you out. You've raised a great topic! Please provide as much detail as you can so we can assist you effectively. Welcome aboard!
2828
pr-message: |
29-
Hi there! 👋 Thank you for submitting your pull request to CodeHarborHub. Great job on the contribution! 🎉 We appreciate your efforts and our team will review it soon. If you have any questions or need further assistance, feel free to reach out. Keep up the great work!
29+
Hi @${{ github.actor }}! 👋 Thank you for submitting your first pull request to CodeHarborHub. Great job on the contribution! 🎉 We appreciate your efforts and our team will review it soon. If you have any questions or need further assistance, feel free to reach out. Keep up the great work!
3030
3131
- name: Assign issue or pull request to team member
3232
if: github.event_name == 'issues' || github.event_name == 'pull_request_target'
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: Lighthouse Report
2+
3+
on:
4+
pull_request_target:
5+
branches:
6+
- main
7+
- codeharborhub-v**
8+
9+
permissions:
10+
contents: read
11+
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
14+
cancel-in-progress: true
15+
16+
jobs:
17+
lighthouse-report:
18+
permissions:
19+
pull-requests: write # for marocchino/sticky-pull-request-comment
20+
name: Lighthouse Report
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v4.1.7
25+
26+
- name: Use Node.js
27+
uses: actions/setup-node@v4.0.3
28+
with:
29+
node-version: 20
30+
31+
- name: Install dependencies
32+
run: npm ci
33+
34+
- name: Build website
35+
run: npm run build
36+
37+
- name: Audit URLs using Lighthouse
38+
id: lighthouse_audit
39+
uses: treosh/lighthouse-ci-action@12.1.0
40+
with:
41+
urls: |
42+
http://localhost:3000
43+
http://localhost:3000/docs
44+
http://localhost:3000/docs/category/javascript
45+
http://localhost:3000/courses
46+
http://localhost:3000/courses/category/reactjs
47+
http://localhost:3000/dsa-problems
48+
http://localhost:3000/dsa-problems/category/leetcode-problems
49+
http://localhost:3000/dsa-solutions
50+
http://localhost:3000/dsa-solutions/category/leetcode-solutions
51+
http://localhost:3000/blog
52+
http://localhost:3000/showcase
53+
http://localhost:3000/community
54+
http://localhost:3000/docs/tags
55+
http://localhost:3000/product
56+
configPath: ./.github/workflows/lighthouserc.json
57+
uploadArtifacts: true
58+
temporaryPublicStorage: true
59+
60+
- name: Format lighthouse score
61+
id: format_lighthouse_score
62+
uses: actions/github-script@v7.0.1
63+
with:
64+
github-token: ${{ secrets.GITHUB_TOKEN }}
65+
script: |
66+
const results = ${{ steps.lighthouse_audit.outputs.manifest }}
67+
const links = ${{ steps.lighthouse_audit.outputs.links }}
68+
const createLighthouseReport = (await import(`${process.env.GITHUB_WORKSPACE}/admin/scripts/formatLighthouseReport.js`)).default;
69+
const comment = createLighthouseReport({ results, links });
70+
core.setOutput("comment", comment);
71+
72+
- name: Add Lighthouse stats as comment
73+
id: comment_to_pr
74+
uses: marocchino/sticky-pull-request-comment@v2.9.0
75+
with:
76+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
77+
number: ${{ github.event.pull_request.number }}
78+
header: lighthouse
79+
message: ${{ steps.format_lighthouse_score.outputs.comment }}

0 commit comments

Comments
 (0)