Skip to content

Commit 24e7242

Browse files
authored
Merge branch 'main' into How-to-Set-Up-Goose-on-Windows
2 parents 2de6b66 + 78b6269 commit 24e7242

File tree

3 files changed

+63
-16
lines changed

3 files changed

+63
-16
lines changed

.github/workflows/update-loosegoose-leaderboard.yml

+56-16
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,15 @@ jobs:
2929
];
3030
3131
const calculatePoints = (labels) => {
32-
return 10;
32+
const labelNames = labels.map(label => label.name.toLowerCase());
33+
const hasLooseGoose = labelNames.includes('loosegoose');
34+
const hasCode = labelNames.includes('code');
35+
36+
return {
37+
points: hasLooseGoose && hasCode ? 15 : (hasLooseGoose ? 10 : 0),
38+
isCodePR: hasCode,
39+
isContentPR: hasLooseGoose && !hasCode
40+
};
3341
};
3442
3543
const fetchRecentPRs = async (repo) => {
@@ -55,13 +63,18 @@ jobs:
5563
const isRecent = new Date(pr.merged_at) > new Date(thirtyDaysAgo);
5664
const isLoosegoose = pr.labels.some(label => label.name.toLowerCase() === 'loosegoose');
5765
return isMerged && isRecent && isLoosegoose;
58-
}).map(pr => ({
59-
user: pr.user.login,
60-
points: calculatePoints(pr.labels),
61-
repo: repo,
62-
prNumber: pr.number,
63-
prTitle: pr.title,
64-
}));
66+
}).map(pr => {
67+
const pointsData = calculatePoints(pr.labels);
68+
return {
69+
user: pr.user.login,
70+
points: pointsData.points,
71+
isCodePR: pointsData.isCodePR,
72+
isContentPR: pointsData.isContentPR,
73+
repo: repo,
74+
prNumber: pr.number,
75+
prTitle: pr.title,
76+
};
77+
});
6578
return loosegoosePRs;
6679
} catch (error) {
6780
console.error(`Error fetching PRs for ${repo}: ${error.message}`);
@@ -74,9 +87,22 @@ jobs:
7487
const allPRs = await Promise.all(REPOS.map(fetchRecentPRs));
7588
const flatPRs = allPRs.flat();
7689
const leaderboard = flatPRs.reduce((acc, pr) => {
77-
if (!acc[pr.user]) acc[pr.user] = { points: 0, prs: 0 };
90+
if (!acc[pr.user]) {
91+
acc[pr.user] = {
92+
points: 0,
93+
prs: 0,
94+
codePRs: 0,
95+
contentPRs: 0
96+
};
97+
}
7898
acc[pr.user].points += pr.points;
7999
acc[pr.user].prs += 1;
100+
if (pr.isCodePR) {
101+
acc[pr.user].codePRs += 1;
102+
}
103+
if (pr.isContentPR) {
104+
acc[pr.user].contentPRs += 1;
105+
}
80106
return acc;
81107
}, {});
82108
@@ -86,7 +112,9 @@ jobs:
86112
rank: index + 1,
87113
username,
88114
points: data.points,
89-
prs: data.prs
115+
prs: data.prs,
116+
codePRs: data.codePRs,
117+
contentPRs: data.contentPRs
90118
}));
91119
} catch (error) {
92120
console.error(`Error generating leaderboard: ${error.message}`);
@@ -97,7 +125,7 @@ jobs:
97125
const updateIssue = async (leaderboardData) => {
98126
try {
99127
const rows = leaderboardData.map(entry =>
100-
`| ${entry.rank} | @${entry.username} | ${entry.points} | ${entry.prs} |`
128+
`| ${entry.rank} | @${entry.username} | ${entry.points} | ${entry.prs} | ${entry.codePRs} | ${entry.contentPRs} |`
101129
).join('\n');
102130
103131
const issueBody = [
@@ -106,18 +134,23 @@ jobs:
106134
'',
107135
'## This event is open to both employees and external contributors! 🦢',
108136
'### 🌟 **Current Rankings:**',
109-
'| Rank | Contributor | Points | PRs |',
110-
'|------|-------------|--------|-----|',
137+
'| Rank | Contributor | Points | Total PRs | Code PRs | Content PRs |',
138+
'|------|-------------|--------|-----------|-----------|-------------|',
111139
rows,
112140
'',
113141
'### 📜 How It Works:',
114-
'The top 3 contributors with the most points will earn $$$ gift cards (more on rewards below). To earn your place in the leaderboard, you want to close the most PRs to earn the most points. As you complete a task by successfully merging a PR, you will automatically be granted 10 points per task completed.',
142+
'The top 3 contributors with the most points will earn $$$ gift cards (more on rewards below). Points are awarded based on the following criteria:',
143+
'- 15 points for each merged PR with both `loosegoose` and `code` labels',
144+
'- 10 points for each merged PR with just the `loosegoose` label (Content PR)',
115145
'',
116146
'### 🎁 Rewards',
117147
'- Among our **top 3**? Our Top 3 Superstars earn $150 gift cards on Amazon. Stay tuned for the winners!',
118148
'',
119149
'### FAQ',
120150
'- **Frequency of Updates:** The leaderboard will be updated every 1 hour.',
151+
'- **Points System:**',
152+
' - 15 points: Code PRs (PRs with both `loosegoose` and `code` labels)',
153+
' - 10 points: Content PRs (PRs with just the `loosegoose` label)',
121154
'- **Criteria:** Rankings are based on how many points you earn and PRs you close in the goose-plugins repo. To ensure your PRs are successfully merged:',
122155
' - Ensure your contributions are aligned with our [project\'s CoC](https://github.com/block-open-source/goose-plugins/blob/main/CODE_OF_CONDUCT.md).',
123156
' - Refer to our [Contributing Guide](https://github.com/block-open-source/goose-plugins/blob/main/CONTRIBUTING.md).',
@@ -156,16 +189,23 @@ jobs:
156189
'',
157190
'## This event is open to both employees and external contributors! 🦢',
158191
'### 🌟 **Current Rankings:**',
192+
'| Rank | Contributor | Points | Total PRs | Code PRs | Content PRs |',
193+
'|------|-------------|--------|-----------|-----------|-------------|',
159194
'No qualifying PRs found at this time. Check back soon!',
160195
'',
161196
'### 📜 How It Works:',
162-
'The top 3 contributors with the most points will earn $$$ gift cards (more on rewards below). To earn your place in the leaderboard, you want to close the most PRs to earn the most points. As you complete a task by successfully merging a PR, you will automatically be granted 10 points per task completed.',
197+
'The top 3 contributors with the most points will earn $$$ gift cards (more on rewards below). Points are awarded based on the following criteria:',
198+
'- 15 points for each merged PR with both `loosegoose` and `code` labels (Code PR)',
199+
'- 10 points for each merged PR with just the `loosegoose` label (Content PR)',
163200
'',
164201
'### 🎁 Rewards',
165202
'- Among our **top 3**? Our Top 3 Superstars earn $150 gift cards on Amazon. Stay tuned for the winners!',
166203
'',
167204
'### FAQ',
168205
'- **Frequency of Updates:** The leaderboard will be updated every 1 hour.',
206+
'- **Points System:**',
207+
' - 15 points: Code PRs (PRs with both `loosegoose` and `code` labels)',
208+
' - 10 points: Content PRs (PRs with just the `loosegoose` label)',
169209
'- **Criteria:** Rankings are based on how many points you earn and PRs you close in the goose-plugins repo. To ensure your PRs are successfully merged:',
170210
' - Ensure your contributions are aligned with our [project\'s CoC](https://github.com/block-open-source/goose-plugins/blob/main/CODE_OF_CONDUCT.md).',
171211
' - Refer to our [Contributing Guide](https://github.com/block-open-source/goose-plugins/blob/main/CONTRIBUTING.md).',
@@ -186,4 +226,4 @@ jobs:
186226
body: emptyIssueBody
187227
});
188228
console.log("Updated issue with empty leaderboard message.");
189-
}
229+
}

content/content.json

+7
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,13 @@
6363
"link": "https://x.com/kirantweets99/status/1857436757307867594",
6464
"contributor": "Kiran Baliga"
6565
},
66+
{
67+
"type": "social",
68+
"thumbnail": "./img/gooseopenai.png",
69+
"title": "Using Goose with OpenAI",
70+
"link": "https://x.com/kirantweets99/status/1857800570574352500",
71+
"contributor": "Kiran Baliga"
72+
},
6673
{
6774
"type": "blog",
6875
"thumbnail": "https://dev-to-uploads.s3.amazonaws.com/uploads/articles/73stdcqp8ek29digbsj1.png",

content/img/gooseopenai.png

1.78 MB
Loading

0 commit comments

Comments
 (0)