Skip to content

Commit c1e3df0

Browse files
committed
Merge branch 'main' of github.com:sugarlabs/www-v2 into blogs/update_with_authors
2 parents 5f98066 + 79c750b commit c1e3df0

Some content is hidden

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

41 files changed

+4708
-2140
lines changed

.github/workflows/bot.yml

Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
name: Status Bot
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- opened
7+
- synchronize
8+
9+
jobs:
10+
check-pr-status:
11+
name: Workflow Status Check
12+
runs-on: ubuntu-latest
13+
permissions:
14+
pull-requests: write
15+
contents: read
16+
issues: write
17+
actions: read
18+
19+
steps:
20+
- name: Checkout Repository
21+
uses: actions/checkout@v4
22+
with:
23+
ref: ${{ github.event.pull_request.head.sha }}
24+
25+
- name: Setup Node.js
26+
uses: actions/setup-node@v4
27+
with:
28+
node-version: '22'
29+
30+
- name: Install Dependencies
31+
run: npm install
32+
33+
- name: Run Build Test (CI Check)
34+
id: ci-check
35+
run: |
36+
if npm run build; then
37+
echo "CI_PASSED=true" >> $GITHUB_ENV
38+
echo "CI_ERROR=" >> $GITHUB_ENV
39+
else
40+
echo "CI_PASSED=false" >> $GITHUB_ENV
41+
echo "CI_ERROR=Build failed" >> $GITHUB_ENV
42+
fi
43+
44+
- name: Run Linting Checks
45+
id: lint-check
46+
run: |
47+
LINT_ERRORS=""
48+
LINT_PASSED=true
49+
50+
# Run TypeScript linting
51+
if ! npm run lint:ts; then
52+
LINT_PASSED=false
53+
LINT_ERRORS="${LINT_ERRORS}• TypeScript linting failed\n"
54+
fi
55+
56+
# Run Markdown linting
57+
if ! npm run lint:md; then
58+
LINT_PASSED=false
59+
LINT_ERRORS="${LINT_ERRORS}• Markdown linting failed\n"
60+
fi
61+
62+
# Check code formatting with Prettier
63+
if ! npm run format:check; then
64+
LINT_PASSED=false
65+
LINT_ERRORS="${LINT_ERRORS}• Code formatting issues detected\n"
66+
fi
67+
68+
echo "LINT_PASSED=$LINT_PASSED" >> $GITHUB_ENV
69+
echo "LINT_ERRORS<<EOF" >> $GITHUB_ENV
70+
echo -e "$LINT_ERRORS" >> $GITHUB_ENV
71+
echo "EOF" >> $GITHUB_ENV
72+
73+
- name: Generate PR Comment
74+
id: generate-comment
75+
run: |
76+
# Extract PR number
77+
PR_NUMBER=$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH")
78+
79+
# Generate a temporary file for the comment
80+
COMMENT_FILE=$(mktemp)
81+
82+
# Save variables to GITHUB_OUTPUT
83+
echo "PR_NUMBER=$PR_NUMBER" >> $GITHUB_OUTPUT
84+
echo "COMMENT_FILE=$COMMENT_FILE" >> $GITHUB_OUTPUT
85+
86+
# Generate content for the comment file
87+
{
88+
if [ "$CI_PASSED" = "true" ] && [ "$LINT_PASSED" = "true" ]; then
89+
echo "## 🎉 All Checks Passed!"
90+
echo ""
91+
echo "> **Status:** ✅ Ready to merge"
92+
echo ""
93+
echo "### ✅ Completed Workflows"
94+
echo ""
95+
echo "| Workflow | Status | Details |"
96+
echo "|----------|--------|---------|"
97+
echo "| 🔨 **Continuous Integration** | ✅ Passed | Build completed successfully |"
98+
echo "| 📝 **Code Linting** | ✅ Passed | All formatting and style checks passed |"
99+
echo ""
100+
echo "---"
101+
echo ""
102+
echo "🚀 **This PR is ready for review and can be safely merged to \`main\` branch!**"
103+
echo ""
104+
echo "*Great work! Your code meets all quality standards.* 👏"
105+
else
106+
echo "## ❌ Checks Failed"
107+
echo ""
108+
echo "> **Status:** 🚫 Not ready to merge"
109+
echo ""
110+
echo "Please fix the following issues before merging:"
111+
echo ""
112+
113+
if [ "$CI_PASSED" = "false" ]; then
114+
echo "### 🔨 Continuous Integration Failed"
115+
echo ""
116+
echo "**Issue:** The build process failed to complete."
117+
echo ""
118+
echo "**How to fix:**"
119+
echo "1. Run \`npm run build\` locally to identify the issue"
120+
echo "2. Fix any TypeScript compilation errors"
121+
echo "3. Ensure all dependencies are properly installed"
122+
echo "4. Test your changes before pushing"
123+
echo ""
124+
echo "---"
125+
echo ""
126+
fi
127+
128+
if [ "$LINT_PASSED" = "false" ]; then
129+
echo "### 📝 Code Linting Failed"
130+
echo ""
131+
echo "**Issue:** Code formatting or style violations detected."
132+
echo ""
133+
if [ -n "$LINT_ERRORS" ]; then
134+
echo "**Specific problems:**"
135+
echo ""
136+
echo -e "$LINT_ERRORS"
137+
echo ""
138+
fi
139+
echo "**How to fix:**"
140+
echo ""
141+
echo "| Platform | Command | Description |"
142+
echo "|----------|---------|-------------|"
143+
echo "| 🐧 **Unix/macOS/Linux** | \`npm run format\` | Auto-fix all formatting issues |"
144+
echo "| 🪟 **Windows** | \`npm run format:file <filename>\` | Fix specific files |"
145+
echo "| 🔍 **Check Only** | \`npm run format:check\` | Check formatting without fixing |"
146+
echo ""
147+
echo "**Need help with linting?** Check out the [Linting Guide for Windows Users](https://github.com/sugarlabs/www-v2/pull/12) for detailed instructions."
148+
echo ""
149+
echo "---"
150+
echo ""
151+
fi
152+
153+
echo "### 🛠️ Next Steps"
154+
echo ""
155+
echo "1. **Fix the issues** mentioned above"
156+
echo "2. **Test locally** to ensure everything works"
157+
echo "3. **Push your fixes** to this branch"
158+
echo "4. **Wait for re-check** - This bot will automatically run again"
159+
echo ""
160+
echo "> 🤖 *This comment will be updated automatically when you push new commits*"
161+
fi
162+
} > "$COMMENT_FILE"
163+
164+
- name: Comment on PR
165+
uses: thollander/actions-comment-pull-request@v3
166+
with:
167+
file-path: ${{ steps.generate-comment.outputs.COMMENT_FILE }}
168+
pr-number: ${{ steps.generate-comment.outputs.PR_NUMBER }}
169+
github-token: ${{ secrets.GITHUB_TOKEN }}

docs/GSoC-Blogpost-Guidelines.md

Lines changed: 63 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,63 @@
1-
# GSoC 25 Blogpost Guidelines
1+
# GSoC '25 Blogpost Guidelines
22

3-
This document explains how to write and format your weekly GSoC 25 updates for the Sugar Labs website. Follow these instructions to ensure consistency and clarity across all posts.
3+
This document explains how to write and format your weekly GSoC '25 updates for the Sugar Labs website. Follow these instructions to ensure consistency and clarity across all posts.
44

55
<!-- markdownlint-disable -->
66

7-
## 1. Official Template
7+
## Step 1: Create Your Author Profile (One-time setup)
88

9-
Use the exact template below for every GSoC ’25 week update or you will also find this under `constants/MarkdownFiles/posts/GSoC_Template.md`. Copy it into `constants/MarkdownFiles/posts/gsoc-25-username-weekXX.md`, then fill in your details.
9+
Before writing your first blog post, you need to create an author profile that will be linked to all your posts.
10+
11+
1. **Create a new file** in `constants/MarkdownFiles/authors/` named `your-username.md`
12+
2. **Use this template** and replace the placeholder information:
13+
14+
```markdown
15+
---
16+
name: "Your Full Name"
17+
slug: "your-username"
18+
title: "GSoC'25 Contributor"
19+
organization: "SugarLabs"
20+
description: "GSoC'25 Contributor at SugarLabs"
21+
avatar: "https://avatars.githubusercontent.com/u/YOUR_GITHUB_ID?s=400"
22+
---
23+
24+
<!--markdownlint-disable-->
25+
26+
# About [Your Name]
27+
28+
Write something about yourself
29+
30+
## Experience
31+
32+
Write some experience or other categories that you want to add
33+
34+
## Current Projects
35+
36+
Your Projects or other sections
37+
38+
## Connect with Me
39+
40+
- **GitHub**: [@your-username](https://github.com/your-username)
41+
- **Email**: [[email protected]](mailto:[email protected])
42+
- **LinkedIn**: [Your Name](https://linkedin.com/in/your-profile)
43+
- **Twitter**: [@your_handle](https://twitter.com/your_handle)
44+
- **Website**: [yourwebsite.com](https://yourwebsite.com) *(optional)*
45+
- **Discord**: [your#1234](https://discord.com/users/your#1234) *(optional)*
46+
```
47+
48+
## Step 2: Official GSoC Blog Post Template
49+
50+
Use the exact template below for every GSoC '25 week update. You can also find this under `constants/MarkdownFiles/posts/YYYY-MM-DD-GSoC_DMP_SSoC_Template.md`. Copy it into `constants/MarkdownFiles/posts/YYYY-MM-DD-gsoc-25-username-weekXX.md`, then fill in your details.
1051

1152
```markdown
1253
---
13-
title: "GSoC ’25 Week XX Update by Safwan Sayeed"
14-
excerpt: "This is a Template to write Blog Posts for weekly updates"
15-
category: "TEMPLATE"
16-
date: "2025-05-10"
17-
slug: "gsoc-25-sa-fw-an-weekX"
18-
author: "Safwan Sayeed"
19-
description: "Maintainer and GSoC'25 Contributor at SugarLabs"
20-
tags: "gsoc25,sugarlabs,weekXX,sa-fw-an"
54+
title: "GSoC '25 Week XX Update by [Your Name]"
55+
excerpt: "Brief description of this week's progress"
56+
category: "DEVELOPER NEWS"
57+
date: "2025-06-14"
58+
slug: ""YYYY-MM-DD-gsoc-25-username-weekXX""
59+
author: "@/constants/MarkdownFiles/authors/your-username.md"
60+
tags: "gsoc25,sugarlabs,weekXX,username"
2161
image: "assets/Images/GSOC.png"
2262
---
2363

@@ -40,7 +80,7 @@ image: "assets/Images/GSOC.png"
4080

4181
---
4282

43-
## This Weeks Achievements
83+
## This Week's Achievements
4484

4585
1. **[Task or Feature]**
4686
- What you did and why it matters.
@@ -74,7 +114,7 @@ image: "assets/Images/GSOC.png"
74114

75115
---
76116

77-
## Next Weeks Roadmap
117+
## Next Week's Roadmap
78118

79119
- Implement **Feature XYZ** and write corresponding tests.
80120
- Refine **technical design** based on mentor feedback.
@@ -96,39 +136,31 @@ image: "assets/Images/GSOC.png"
96136
Thank you to my mentors, the Sugar Labs community, and fellow GSoC contributors for ongoing support.
97137

98138
---
99-
100-
## Connect with Me
101-
102-
- GitHub: [@sa-fw-an](https://github.com/sa-fw-an)
103-
104-
- LinkedIn: [Safwan Sayeed](https://www.linkedin.com/in/safwan-sayeed-6a3a482a9/)
105-
- Twitter: [@safwan_say](https://twitter.com/safwan_say)
106-
107-
---
108-
109139
```
110140

111-
## 2. Updating Your Post
141+
## Updating Your Post
112142

113143
1. Change the frontmatter `category` from `"TEMPLATE"` to `"DEVELOPER NEWS"`.
114144
2. Replace placeholder text:
115145
- **Week XX**, dates, PR/issue numbers, links, screenshot URLs.
116146
- Your project name, mentor usernames, reporting period.
117-
3. Update `title`, `excerpt`, `date`, `slug`, `author`, `description`, `tags`, `image`.
118-
4. Please keep (`<!-- markdownlint-disable -->`) to disable any markdown linting.
119-
5. Change the contents of the file accordingly.
147+
3. Update `title`, `excerpt`, `date`, `slug`, `author`, `tags`, `image`.
148+
4. The `author` field should point to your author file: `"@/constants/MarkdownFiles/authors/your-username.md"`
149+
5. Please keep (`<!-- markdownlint-disable -->`) to disable any markdown linting.
150+
6. Change the contents of the file accordingly.
151+
7. **Remove the "Connect with Me" section** from your blog post - this information is now in your author profile.
120152

121-
## 3. File & PR Workflow
153+
## File & PR Workflow
122154

123155
- Branch off `main` with `gsoc-weekXX-username`.
124156
- Add your file under `constants/MarkdownFiles/posts/`.
125157
- Commit and open a PR titled:
126158
```
127-
GSoC 25 Week XX Update by Name
159+
GSoC '25 Week XX Update by Name
128160
```
129161
- In PR description, link any issue tracking the weekly report and ping your mentors.
130162
- After review, squash-and-merge.
131163

132164
---
133165

134-
By strictly following this template and these steps, we ensure every GSoC 25 post is uniform and high quality. Happy writing!
166+
By strictly following this template and these steps, we ensure every GSoC '25 post is uniform and high quality. Happy writing!

0 commit comments

Comments
 (0)