1+ name : Haftalik Aktivite Raporu
2+
3+ on :
4+ schedule :
5+ - cron : ' 0 14 * * 5' # Her Cuma 17:00 TR (14:00 UTC)
6+ workflow_dispatch : # Manuel tetikleme
7+
8+ jobs :
9+ report :
10+ runs-on : ubuntu-latest
11+ steps :
12+ - uses : actions/checkout@v4
13+ with :
14+ fetch-depth : 0
15+
16+ - name : Haftalik Rapor Olustur
17+ env :
18+ GH_TOKEN : ${{ github.token }}
19+ run : |
20+ REPO="${{ github.repository }}"
21+ SINCE=$(date -d '7 days ago' --iso-8601)
22+ TODAY=$(date --iso-8601)
23+
24+ # Commit sayisi
25+ COMMIT_COUNT=$(git log --since="$SINCE" --oneline 2>/dev/null | wc -l)
26+
27+ # Contributor listesi
28+ CONTRIBUTORS=$(git log --since="$SINCE" --format='%an' 2>/dev/null | sort -u | tr '\n' ', ' | sed 's/,$//')
29+
30+ # Acilan PR sayisi
31+ PR_OPENED=$(gh pr list --repo "$REPO" --state all --search "created:>=$SINCE" --json number --jq 'length' 2>/dev/null || echo "0")
32+
33+ # Merge edilen PR sayisi
34+ PR_MERGED=$(gh pr list --repo "$REPO" --state merged --search "merged:>=$SINCE" --json number --jq 'length' 2>/dev/null || echo "0")
35+
36+ # Acik issue sayisi
37+ OPEN_ISSUES=$(gh issue list --repo "$REPO" --state open --json number --jq 'length' 2>/dev/null || echo "0")
38+
39+ # Rapor metni
40+ REPORT="📊 *Haftalik Rapor: ${REPO#*/}*\n📅 $SINCE → $TODAY\n\n"
41+ REPORT+="📝 Commit: $COMMIT_COUNT\n"
42+ REPORT+="🔀 PR Acilan: $PR_OPENED | Merge: $PR_MERGED\n"
43+ REPORT+="📋 Acik Issue: $OPEN_ISSUES\n"
44+
45+ if [ -n "$CONTRIBUTORS" ]; then
46+ REPORT+="👥 Katkilar: $CONTRIBUTORS\n"
47+ fi
48+
49+ if [ "$COMMIT_COUNT" -eq 0 ] && [ "$PR_OPENED" -eq "0" ]; then
50+ REPORT+="\n⚠️ Bu hafta bu repoda aktivite yok."
51+ fi
52+
53+ echo "Rapor:"
54+ echo -e "$REPORT"
55+
56+ # Slack'e gonder
57+ curl -s -X POST https://slack.com/api/chat.postMessage \
58+ -H "Authorization: Bearer ${{ secrets.SLACK_BOT_TOKEN }}" \
59+ -H "Content-Type: application/json" \
60+ -d "{
61+ \"channel\": \"${{ secrets.SLACK_DEV_CHANNEL_ID }}\",
62+ \"text\": \"$REPORT\"
63+ }"
0 commit comments