File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
12name : Challenge Submission
2- description : Submit your solution for a weekly challenge.
3+ about : Submit your solution for a weekly challenge.
34title : " [Week X] Challenge Submission - YOUR_USERNAME"
45labels : challenge, submission
56assignees : ' '
Original file line number Diff line number Diff line change @@ -18,21 +18,22 @@ jobs:
1818 script : |
1919 const issue = context.payload.issue || context.payload.pull_request;
2020 if (!issue) return;
21+ const title = typeof issue.title === "string" ? issue.title : "";
2122
2223 const labelsToAdd = [];
2324
2425 // Auto-label PRs as challenge submissions if they include week-X in title
25- if (issue. title.match(/week-\d+/i)) {
26+ if (title.match(/week-\d+/i)) {
2627 labelsToAdd.push("challenge");
2728 }
2829
2930 // Auto-label issues that include "question"
30- if (issue. title.toLowerCase().includes("question")) {
31+ if (title.toLowerCase().includes("question")) {
3132 labelsToAdd.push("question");
3233 }
3334
3435 // Auto-label issues that include "bug"
35- if (issue. title.toLowerCase().includes("bug")) {
36+ if (title.toLowerCase().includes("bug")) {
3637 labelsToAdd.push("bug");
3738 }
3839
Original file line number Diff line number Diff line change 1+ name : Welcome New Contributors
2+
3+ on :
4+ pull_request :
5+ types : [opened]
6+ issues :
7+ types : [opened]
8+ workflow_dispatch :
9+
10+ jobs :
11+ welcome :
12+ runs-on : ubuntu-latest
13+ steps :
14+ - name : Welcome Contributor
15+ uses : actions/github-script@v7
16+ with :
17+ github-token : ${{ secrets.GITHUB_TOKEN }}
18+ script : |
19+ const issue = context.payload.issue || context.payload.pull_request;
20+ if (!issue) return;
21+
22+ const login = issue.user.login;
23+ const repo = context.repo.repo;
24+
25+ // Only welcome first-time contributors
26+ const result = await github.rest.search.issuesAndPullRequests({
27+ q: `repo:${context.repo.owner}/${repo} author:${login}`
28+ });
29+ const isFirstTime = (result.data.total_count === 0);
30+
31+ if (isFirstTime) {
32+ const welcomeMessage = `
33+ Hi @${login}! 👋
34+
35+ Welcome to **ReactSphere Community Challenges**! 🎉
36+
37+ Here’s how to get started :
38+ - Check out the weekly challenges in [challenges/](https://github.com/${context.repo.owner}/${repo}/tree/main/challenges)
39+ - Submit your solutions via Pull Requests
40+ - Track your progress on the [Leaderboard](https://github.com/${context.repo.owner}/${repo}/blob/main/LEADERBOARD.md)
41+ - Join discussions or ask questions via Issues or Discussions
42+
43+ Happy contributing! 🚀
44+ ` ;
45+
46+ await github.rest.issues.createComment({
47+ owner: context.repo.owner,
48+ repo,
49+ issue_number: issue.number,
50+ body: welcomeMessage
51+ });
52+ }
You can’t perform that action at this time.
0 commit comments