Skip to content

Commit a77b046

Browse files
committed
Add AI-generated summary to weekly reports using gh copilot with gpt-5-mini
1 parent 07cb41d commit a77b046

1 file changed

Lines changed: 41 additions & 2 deletions

File tree

.github/workflows/fvutils-weekly-report.yaml

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ jobs:
2121
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
2222
&& sudo apt update \
2323
&& sudo apt install gh -y)
24+
25+
- name: Install GitHub Copilot CLI
26+
env:
27+
GH_TOKEN: ${{ github.token }}
28+
run: |
29+
gh extension install github/gh-copilot || gh extension upgrade gh-copilot || true
2430
2531
- name: Gather Weekly Activity
2632
env:
@@ -65,6 +71,33 @@ jobs:
6571
6672
cat /tmp/activity.md
6773
74+
- name: Generate AI Summary
75+
env:
76+
GH_TOKEN: ${{ github.token }}
77+
run: |
78+
# Read the activity data
79+
ACTIVITY=$(cat /tmp/activity.md)
80+
81+
# Create prompt for summary
82+
cat > /tmp/prompt.txt << 'PROMPT_EOF'
83+
Based on the following weekly activity report, create a concise summary paragraph (3-4 sentences) that highlights the key accomplishments and identifies a theme for the week's work. Focus on what was achieved and the overall direction of development.
84+
85+
PROMPT_EOF
86+
87+
cat /tmp/activity.md >> /tmp/prompt.txt
88+
89+
# Generate summary using gh copilot with gpt-5-mini
90+
# Use 'gh copilot' in non-interactive mode to get a text response
91+
gh copilot explain --model gpt-5-mini "$(cat /tmp/prompt.txt)" 2>&1 | tee /tmp/copilot_output.txt || true
92+
93+
# Extract the meaningful content, skip headers/footers from gh copilot
94+
# The output usually has explanation text we want to capture
95+
grep -v "^Explanation:" /tmp/copilot_output.txt | grep -v "^$" | head -n 10 > /tmp/summary.md
96+
97+
echo "" >> /tmp/summary.md
98+
echo "Generated AI summary:"
99+
cat /tmp/summary.md
100+
68101
- name: Create Discussion Post
69102
env:
70103
GH_TOKEN: ${{ github.token }}
@@ -73,8 +106,14 @@ jobs:
73106
YEAR=$(date -u +%Y)
74107
TITLE="Weekly Update - Week $WEEK_NUM, $YEAR"
75108
76-
# Use the activity report as the discussion body
77-
cat /tmp/activity.md > /tmp/discussion_body.md
109+
# Build discussion body with AI summary first, then detailed activity
110+
echo "## Summary" > /tmp/discussion_body.md
111+
echo "" >> /tmp/discussion_body.md
112+
cat /tmp/summary.md >> /tmp/discussion_body.md
113+
echo "" >> /tmp/discussion_body.md
114+
echo "---" >> /tmp/discussion_body.md
115+
echo "" >> /tmp/discussion_body.md
116+
cat /tmp/activity.md >> /tmp/discussion_body.md
78117
echo "" >> /tmp/discussion_body.md
79118
echo "---" >> /tmp/discussion_body.md
80119
echo "" >> /tmp/discussion_body.md

0 commit comments

Comments
 (0)