Skip to content

Commit 4090bc1

Browse files
committed
manual update
1 parent c95561c commit 4090bc1

1 file changed

Lines changed: 6 additions & 49 deletions

File tree

.github/workflows/gh_statistics_bot.yml

Lines changed: 6 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
name: Monthly Repository Statistics
22

33
on:
4-
pull_request:
5-
types: [opened, synchronize]
6-
schedule:
7-
- cron: "0 9 1 * *"
84
workflow_dispatch:
95

106
jobs:
@@ -20,8 +16,6 @@ jobs:
2016

2117
- name: Generate Enhanced Monthly Statistics
2218
uses: actions/github-script@v7
23-
env:
24-
MATTERMOST_WEBHOOK_URL: ${{ secrets.MATTERMOST_WEBHOOK_URL }}
2519
with:
2620
script: |
2721
// Enhanced stats with additional metrics - main branch focused
@@ -361,8 +355,7 @@ jobs:
361355
});
362356
363357
// Create new branch
364-
const now = new Date();
365-
const branchName = `update-stats-${now.getFullYear()}-${(now.getMonth()).toString().padStart(2, '0')}`;
358+
const branchName = 'monthly-stats';
366359
367360
try {
368361
const mainRef = await github.rest.git.getRef({
@@ -465,48 +458,12 @@ jobs:
465458
466459
const latest = monthlyData[monthlyData.length - 1];
467460
468-
const mattermostPayload = {
469-
text: `📊 **${latest.month} Repository Activity Report**`,
470-
attachments: [{
471-
color: '#22c55e',
472-
fields: [
473-
// Core Development Activity
474-
{ title: '📝 Total Commits', value: latest.stats.totalCommits.toString(), short: true },
475-
{ title: '👥 Active Contributors', value: latest.stats.activeContributors.toString(), short: true },
476-
{ title: '📈 Lines Added', value: latest.stats.linesAdded.toLocaleString(), short: true },
477-
{ title: '📉 Lines Deleted', value: latest.stats.linesDeleted.toLocaleString(), short: true },
478-
{ title: '⚖️ Total Lines Changed', value: latest.stats.totalLinesChanged.toLocaleString(), short: true },
479-
{ title: '📁 Files Changed', value: latest.stats.filesChanged.toString(), short: true },
480-
481-
// Pull Request Activity
482-
{ title: '🔀 PRs Merged', value: latest.prStats.merged.toString(), short: true },
483-
{ title: '🆕 PRs Opened', value: latest.prStats.opened.toString(), short: true },
484-
{ title: '❌ PRs Closed', value: latest.prStats.closed.toString(), short: true },
485-
486-
// Issue Management
487-
{ title: '🐛 Issues Opened', value: latest.issueStats.opened.toString(), short: true },
488-
{ title: '✅ Issues Closed', value: latest.issueStats.closed.toString(), short: true },
489-
],
490-
text: `**👥 Active Contributors:** ${latest.stats.contributorsList.slice(0, 15).join(', ') || 'None'}\n` +
491-
`**💻 Languages:** ${languages.map(l => `${l.language} (${l.percentage}%)`).join(', ') || 'N/A'}\n\n` +
492-
`**📈 Charts:** [View detailed charts on branch ${branchResult.branchName}](${branchResult.branchUrl})\n` +
493-
`**📊 CSV Report:** [Download CSV file](${branchResult.csvUrl})\n` +
494-
`**🦠 Repository:** ${context.repo.owner}/${context.repo.repo}`,
495-
footer: 'Repository statistics • Generated by GitHub Actions'
496-
}]
497-
};
498-
499-
const response = await fetch(process.env.MATTERMOST_WEBHOOK_URL, {
500-
method: 'POST',
501-
headers: { 'Content-Type': 'application/json' },
502-
body: JSON.stringify(mattermostPayload)
503-
});
504-
505-
if (!response.ok) {
506-
throw new Error(`Mattermost webhook failed: ${response.status}`);
507-
}
508-
509461
console.log('Monthly report completed successfully');
462+
console.log(`Branch: ${branchResult.branchName}`);
463+
console.log(`Branch URL: ${branchResult.branchUrl}`);
464+
console.log(`CSV URL: ${branchResult.csvUrl}`);
465+
console.log(`CSV Filename: ${branchResult.csvFileName}`);
466+
console.log(`Contributors: ${latest.stats.contributorsList.join(', ')}`);
510467
console.log(`Generated stats for ${latest.month}:`);
511468
console.log(`- Commits: ${latest.stats.totalCommits}`);
512469
console.log(`- Contributors: ${latest.stats.activeContributors}`);

0 commit comments

Comments
 (0)