Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 99 additions & 0 deletions .github/workflows/devin-stale-issue-sweep.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
name: Devin AI Stale Issue Sweep

on:
schedule:
# Run daily at 9 AM America/Chicago (14:00 UTC)
- cron: '0 14 * * *'
workflow_dispatch: # Allow manual triggering

jobs:
devin-analysis:
runs-on: ubuntu-latest
steps:
- name: Trigger Devin AI Stale Issue Analysis
env:
DEVIN_API_KEY: ${{ secrets.DEVIN_API_KEY }}
PROMPT: |
**Task: Identify and Report Stale GitHub Issues**

Please analyze the PrefectHQ/prefect repository and identify the top 5 stale issues that could potentially be closed.

**Instructions:**

1. **Analyze Issues for Staleness:**
Consider an issue stale if:
- No activity (comments, updates) for 90+ days
- The issue describes a bug that appears to be fixed in recent commits
- The feature/enhancement is no longer relevant due to architectural changes
- The issue is a duplicate of another resolved issue
- The issue lacks sufficient information and has not been updated

2. **Prioritize Issues:**
- Rank by likelihood of being closable
- Focus on older issues first
- Verify the issue status by checking:
* Recent commit history
* Related PRs
* Code changes that may have resolved the issue

3. **Select Top 5 Issues:**
Choose the 5 most clearly stale issues.

4. **Summary Findings**
- Format a message with:
* Issue number and title
* Link to the issue
* Brief explanation (2-3 sentences) of why it appears stale
* Recommendation (close, needs verification, etc.)
- Use clear formatting (markdown/blocks) for readability

**Expected Output:**

A message with this structure:

```
🧹 Daily Stale Issue Report - [Date]

Found 5 potentially stale issues:

1. Issue #XXXX: [Title]
Link: https://github.com/PrefectHQ/prefect/issues/XXXX
Reason: [Why it appears stale]
Recommendation: [Action to take]

2. Issue #YYYY: [Title]
...

[Continue for all 5 issues]

---
Generated by Devin AI • Session: [session_id]
```

**Important Notes:**
- Start with older issues first
- Do NOT close issues automatically - only report them
- Be conservative - when in doubt, do not flag the issue as stale
- Check for recent activity even if not visible in comments (commits, linked PRs)
- Respect issue labels like "pinned", "good first issue", "help wanted"
run: |
ESCAPED_PROMPT=$(echo "$PROMPT" | jq -Rs .)
# Create Devin session to analyze stale issues
RESPONSE=$(curl -X POST https://api.devin.ai/v1/sessions \
-H "Authorization: Bearer $DEVIN_API_KEY" \
-H "Content-Type: application/json" \
-d "{\"prompt\": $ESCAPED_PROMPT}" \

# Extract and display session information
SESSION_ID=$(echo "$RESPONSE" | jq -r '.session_id // empty')
SESSION_URL=$(echo "$RESPONSE" | jq -r '.session_url // empty')

if [ -n "$SESSION_ID" ]; then
echo "✅ Devin AI session created successfully"
echo "Session ID: $SESSION_ID"
echo "Session URL: $SESSION_URL"
else
echo "❌ Failed to create Devin AI session"
echo "Response: $RESPONSE"
exit 1
fi