-
Notifications
You must be signed in to change notification settings - Fork 16
81 lines (68 loc) · 2.57 KB
/
update-team-workload.yml
File metadata and controls
81 lines (68 loc) · 2.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: Update Team Workload
# Run weekly on Mondays at 9am UTC, or manually
on:
schedule:
- cron: '0 9 * * 1' # Every Monday at 9:00 AM UTC
workflow_dispatch: # Allow manual trigger
permissions:
contents: write
issues: read
pull-requests: read
jobs:
update-workload:
runs-on: ubuntu-latest
name: Update team member contributions
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
cd autoTriage
pip install -r requirements.txt
- name: Update contributions
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cd autoTriage
python scripts/update_contributions.py \
--owner "${{ github.repository_owner }}" \
--repo "${{ github.event.repository.name }}"
- name: Check for changes
id: check_changes
run: |
if git diff --quiet autoTriage/config/team-members.json; then
echo "has_changes=false" >> $GITHUB_OUTPUT
echo "No workload changes detected"
else
echo "has_changes=true" >> $GITHUB_OUTPUT
echo "Workload changes detected"
fi
- name: Commit and push changes
if: steps.check_changes.outputs.has_changes == 'true'
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add autoTriage/config/team-members.json
git commit -m "chore: Update team workload contributions
Automated update based on current open issues and PRs.
[skip ci]"
git push
- name: Create summary
if: always()
run: |
echo "## Team Workload Update" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
if [ "${{ steps.check_changes.outputs.has_changes }}" == "true" ]; then
echo "[OK] Team workload updated based on current open issues" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Changes" >> $GITHUB_STEP_SUMMARY
echo "\`\`\`diff" >> $GITHUB_STEP_SUMMARY
git diff autoTriage/config/team-members.json >> $GITHUB_STEP_SUMMARY || echo "Changes committed" >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
else
echo "[INFO] No workload changes - team is balanced" >> $GITHUB_STEP_SUMMARY
fi