Skip to content

Commit 7a65b50

Browse files
Merge branch 'main' into main
2 parents d339cd2 + 4ab1f3f commit 7a65b50

639 files changed

Lines changed: 155374 additions & 615 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/ISSUE_TEMPLATE/bug_report.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,5 @@ body:
5454
required: true
5555
- label: "I want to work on this issue"
5656
required: false
57+
- label: "I am participating in GSSoC 2026"
58+
required: false

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,6 @@ body:
7373
required: true
7474
- label: "I want to work on this issue"
7575
required: false
76+
- label: "I am participating in GSSoC 2026"
77+
required: false
7678

.github/ISSUE_TEMPLATE/project_proposal.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,3 +104,5 @@ body:
104104
required: true
105105
- label: "I want to work on this issue"
106106
required: false
107+
- label: "I am participating in GSSoC 2026"
108+
required: false

.github/labeler.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
2+
3+
documentation:
4+
- changed-files:
5+
- any-glob-to-any-file:
6+
- '**/*.md'
7+
- 'docs/**'
8+
9+
python:
10+
- changed-files:
11+
- any-glob-to-any-file:
12+
- '**/*.py'
13+
14+
15+
github-actions:
16+
- changed-files:
17+
- any-glob-to-any-file:
18+
- '.github/**'
19+
20+
21+
enhancement:
22+
- changed-files:
23+
- any-glob-to-any-file:
24+
25+
- 'src/**'
26+
- '*/**.py'
27+
28+
beginner:
29+
- changed-files:
30+
31+
- any-glob-to-any-file:
32+
- '**/*.md'
33+
34+
intermediate:
35+
36+
- changed-files:
37+
- any-glob-to-any-file:
38+
- '**/*.py'
39+
40+
41+
advanced:
42+
- changed-files:
43+
- any-glob-to-any-file:
44+
- '.github/**'
45+
- 'tests/**'
46+
47+
"type:design":
48+
- changed-files:
49+
- any-glob-to-any-file:
50+
- 'web-app/**'
51+
- 'web-app/*.html'
52+
- 'web-app/js/**'
53+
- 'web-app/css/**'
54+
55+
"type:feature":
56+
- changed-files:
57+
- any-glob-to-any-file:
58+
- '**/*.py'
59+
60+
"type:docs":
61+
- changed-files:
62+
- any-glob-to-any-file:
63+
- '**/*.md'
64+
- 'README.html'
65+
- 'docs/**'
66+
67+
"type:devops":
68+
- changed-files:
69+
- any-glob-to-any-file:
70+
- '.github/**'
71+
- '.github/workflows/**'
72+
73+
"type:refactor":
74+
- changed-files:
75+
- any-glob-to-any-file:
76+
- '**/*.py'
77+
- 'web-app/**'
78+
79+
"type:bug":
80+
- changed-files:
81+
- any-glob-to-any-file:
82+
- '**/*.py'
83+
- 'tests/**'
84+

.github/pull_request_template.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,5 @@ body:
7575
required: false
7676
- label: "I have updated the README.md (if adding new project)"
7777
required: false
78+
- label: "I am participating in GSSoC 2026"
79+
required: false

.github/workflows/contributors.yml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
name: contributor automation
2+
3+
on:
4+
schedule: # runs daily at midnight
5+
- cron: '0 0 * * *'
6+
pull_request:
7+
types: [closed]
8+
branches:
9+
- main
10+
11+
# allows manual trigger
12+
permissions:
13+
contents: write
14+
15+
jobs:
16+
update-readme:
17+
if: github.event_name != 'pull_request' || github.event.pull_request.merged == true
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
23+
- name: Fetch Merged PR Authors (Pagination)
24+
env:
25+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26+
run: |
27+
set -euo pipefail
28+
PAGE=1
29+
echo "[]" > final_list.json
30+
while true; do
31+
# Using pulls endpoint to capture only merged contributors
32+
RESPONSE=$(gh api "/repos/steam-bell-92/python-mini-project/pulls?state=closed&per_page=100&page=${PAGE}")
33+
COUNT=$(echo "$RESPONSE" | jq '. | length')
34+
if [ "$COUNT" -eq 0 ]; then break; fi
35+
jq -s '.[0] + .[1]' final_list.json <(echo "$RESPONSE") > tmp.json && mv tmp.json final_list.json
36+
PAGE=$((PAGE + 1))
37+
done
38+
# Filters for actual merged PRs and unique users
39+
jq '[.[]
40+
| select(.merged_at != null and .user != null and .user.type != "Bot")
41+
| .user.login]
42+
| unique
43+
| sort' final_list.json > contributors.json
44+
- name: Build Gallery HTML
45+
run: |
46+
set -euo pipefail
47+
GALLERY_HTML=""
48+
for USERNAME in $(jq -r '.[]' contributors.json); do
49+
GALLERY_HTML="${GALLERY_HTML}<a href=\"https://github.com/${USERNAME}\"><img src=\"https://github.com/${USERNAME}.png\" width=\"50px\" loading=\"lazy\" title=\"${USERNAME}\" style=\"border-radius:50%;margin:5px;\" alt=\"${USERNAME}\" /></a>"
50+
done
51+
echo "$GALLERY_HTML" > gallery_fragment.txt
52+
53+
- name: Update README.md
54+
run: |
55+
set -euo pipefail
56+
# Safety check for markers
57+
start_count=$(grep -c '<!-- CONTRIBUTORS_START -->' README.md || true)
58+
end_count=$(grep -c '<!-- CONTRIBUTORS_END -->' README.md || true)
59+
if [ "$start_count" -ne 1 ] || [ "$end_count" -ne 1 ]; then
60+
echo "Error: README.md must contain exactly one pair of markers."
61+
exit 1
62+
fi
63+
64+
start_line=$(grep -n '<!-- CONTRIBUTORS_START -->' README.md | cut -d: -f1)
65+
end_line=$(grep -n '<!-- CONTRIBUTORS_END -->' README.md | cut -d: -f1)
66+
if [ "$start_line" -ge "$end_line" ]; then
67+
echo "Error: CONTRIBUTORS_START must appear before CONTRIBUTORS_END."
68+
exit 1
69+
fi
70+
71+
sed -i '/<!-- CONTRIBUTORS_START -->/,/<!-- CONTRIBUTORS_END -->/ {
72+
/<!-- CONTRIBUTORS_START -->/! { /<!-- CONTRIBUTORS_END -->/! d; }
73+
}' README.md
74+
sed -i '/<!-- CONTRIBUTORS_START -->/r gallery_fragment.txt' README.md
75+
76+
- name: Commit and Push
77+
run: |
78+
git config --global user.name "github-actions[bot]"
79+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
80+
git add README.md
81+
if git diff --staged --quiet; then
82+
echo "No changes to README."
83+
else
84+
git commit -m "docs: update contributor gallery"
85+
git push
86+
fi
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: GSSoC Labeler
2+
3+
on:
4+
issues:
5+
types: [opened, edited]
6+
pull_request_target:
7+
types: [opened, edited]
8+
9+
jobs:
10+
label_gssoc:
11+
runs-on: ubuntu-latest
12+
13+
permissions:
14+
issues: write
15+
pull-requests: write
16+
17+
steps:
18+
- name: Check and add GSSoC label
19+
uses: actions/github-script@v7
20+
with:
21+
script: |
22+
let bodyText = "";
23+
let issueNum = null;
24+
25+
if (context.payload.issue?.body) {
26+
bodyText = context.payload.issue.body;
27+
issueNum = context.payload.issue.number;
28+
}
29+
else if (context.payload.pull_request?.body) {
30+
bodyText = context.payload.pull_request.body;
31+
issueNum = context.payload.pull_request.number;
32+
}
33+
34+
const isGSSoC =
35+
bodyText.includes("[x] I am participating in GSSoC 2026") ||
36+
bodyText.includes("[X] I am participating in GSSoC 2026");
37+
38+
if (isGSSoC && issueNum) {
39+
await github.rest.issues.addLabels({
40+
owner: context.repo.owner,
41+
repo: context.repo.repo,
42+
issue_number: issueNum,
43+
labels: ["gssoc:accepted"],
44+
});
45+
}

.github/workflows/labeler.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Auto Label Issues and PRs
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
issues:
7+
types: [opened, reopened]
8+
9+
permissions:
10+
contents: read
11+
issues: write
12+
pull-requests: write
13+
14+
jobs:
15+
label-pr:
16+
name: Label Pull Requests
17+
runs-on: ubuntu-latest
18+
if: github.event_name == 'pull_request'
19+
steps:
20+
- name: Checkout repository
21+
uses: actions/checkout@v4
22+
23+
- name: Apply labels based on changed files
24+
uses: actions/labeler@v5
25+
with:
26+
repo-token: "${{ secrets.GITHUB_TOKEN }}"
27+
configuration-path: .github/labeler.yml
28+
29+
label-issue:
30+
name: Label Issues
31+
runs-on: ubuntu-latest
32+
if: github.event_name == 'issues'
33+
steps:
34+
- name: Label new issues with gssoc26
35+
uses: actions/github-script@v7
36+
with:
37+
github-token: ${{ secrets.GITHUB_TOKEN }}
38+
script: |
39+
const issue = context.payload.issue;
40+
const body = (issue.body || '').toLowerCase();
41+
const title = (issue.title || '').toLowerCase();
42+
43+
const labelsToAdd = ['gssoc26'];
44+
45+
if (title.includes('bug') || body.includes('bug')) {
46+
labelsToAdd.push('bug');
47+
}
48+
if (title.includes('feature') || body.includes('enhancement')) {
49+
labelsToAdd.push('enhancement');
50+
}
51+
if (title.includes('docs') || body.includes('documentation')) {
52+
labelsToAdd.push('documentation');
53+
}
54+
if (title.includes('level 1') || body.includes('level 1')) {
55+
labelsToAdd.push('level1');
56+
}
57+
if (title.includes('level 2') || body.includes('level 2')) {
58+
labelsToAdd.push('level2');
59+
}
60+
if (title.includes('level 3') || body.includes('level 3')) {
61+
labelsToAdd.push('level3');
62+
}
63+
64+
await github.rest.issues.addLabels({
65+
owner: context.repo.owner,
66+
repo: context.repo.repo,
67+
issue_number: issue.number,
68+
labels: labelsToAdd
69+
});

.github/workflows/pr-merged-thanks.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,27 @@ jobs:
88
thank-contributor:
99
if: github.event.pull_request.merged == true
1010
runs-on: ubuntu-latest
11+
1112
permissions:
13+
pull-requests: write
1214
issues: write
1315

1416
steps:
1517
- name: Thank contributor for the merge
1618
uses: actions/github-script@v7
1719
with:
1820
script: |
19-
github.rest.issues.createComment({
21+
await github.rest.issues.createComment({
2022
issue_number: context.payload.pull_request.number,
2123
owner: context.repo.owner,
2224
repo: context.repo.repo,
23-
body: |
24-
🎉 **Thank you for your contribution!**
25+
body: `🎉 **Thank you for your contribution!**
2526
26-
Your Pull Request has been merged successfully.
27+
Your Pull Request has been merged successfully.
2728
28-
We appreciate the time and effort you put into improving this project. Contributions like yours help the repository grow and stay useful for everyone.
29+
We appreciate the time and effort you put into improving this project. Contributions like yours help the repository grow and stay useful for everyone.
2930
30-
If you'd like to contribute again, please check the open issues and make sure you are assigned before opening another Pull Request.
31+
If you'd like to contribute again, please check the open issues and make sure you are assigned before opening another Pull Request.
3132
32-
Thanks again for your support! 🙌
33-
})
33+
Thanks again for your support! 🙌`
34+
});

.gitignore

18 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)