Skip to content

Convert stale repository identifier to agentic workflow with deep analysis and data visualization - #5372

Merged
pelikhan merged 4 commits into
mainfrom
copilot/convert-to-agentic-workflow
Dec 3, 2025
Merged

pelikhan merged 4 commits into
mainfrom
copilot/convert-to-agentic-workflow

Conversation

Copilot AI commented Dec 3, 2025 •

Copy link
Copy Markdown
Contributor

Replaces the basic GitHub Action that immediately creates issues for stale repositories with an AI agent that performs deep research before reporting.

Implementation

Workflow Structure (.github/workflows/stale-repo-identifier.md)

  • Integrates github/stale-repos@v3 action as data source
  • Agent analyzes each repository across multiple dimensions: commit history, issue/PR activity, releases, health indicators
  • Classifies repositories: truly stale, low activity, false positive, needs attention
  • Creates detailed issues (max 10/run) with evidence-based recommendations
  • Generates data visualizations and charts using Python scientific libraries

Key Enhancements Over Original

  • Multi-signal analysis prevents false positives (seasonal projects, stable mature code, documentation repos)
  • Issue reports include specific metrics, dates, activity trends, and actionable recommendations
  • Edge case handling for archived repos, dependencies, templates, bot-maintained projects
  • Data visualization support with Python (NumPy, Pandas, Matplotlib, Seaborn, SciPy)
  • JSON schema discovery utilities via jq for analyzing complex data structures
  • Chart and graph generation with asset upload capabilities for visual reports

Configuration

  • Engine: Copilot with GitHub MCP toolsets (repos, issues, pull_requests)
  • Trigger: Monthly cron + manual dispatch with org input (defaults to github organization)
  • Safe-outputs: Issue creation with [Stale Repository] prefix and labels, asset uploads for charts
  • Tools: GitHub MCP, Bash, Edit, Python data visualization, jq schema utilities

Usage Example

# Manual run for specific org (defaults to github org)
gh workflow run stale-repo-identifier.md -f organization=myorg

# Agent will analyze output from stale-repos action and create issues like:
# "[Stale Repository] myrepo - Truly Stale"
# With detailed analysis of last commit, issue/PR counts, recommendations
# Including visualizations and charts uploaded as assets

The workflow promotes conservative archival decisions by requiring human review of comprehensive AI-generated analysis with visual insights rather than automated bulk issue creation.

Original prompt

Convert this action to an agentic workflow.

name: stale repo identifier

on:
  workflow_dispatch:
  schedule:
    - cron: "3 2 1 * *"

permissions:
  contents: read

jobs:
  build:
    name: stale repo identifier
    runs-on: ubuntu-latest

    steps:
      - name: Run stale_repos tool
        id: stale-repos
        uses: github/stale-repos@v3
        env:
          GH_TOKEN: ${{ secrets.GH_TOKEN }}
          ORGANIZATION: ${{ secrets.ORGANIZATION }}
          EXEMPT_TOPICS: "keep,template"
          INACTIVE_DAYS: 365
          ADDITIONAL_METRICS: "release,pr"

      - name: Print output of stale_repos tool
        run: echo "${{ steps.stale-repos.outputs.inactiveRepos }}"
     # go agentic from here
      - uses: actions/github-script@v6
        with:
          script: |
            const repos = ${{ steps.stale-repos.outputs.inactiveRepos }}
            for (const repo of repos) {
              console.log(repo);
              const issue = await github.rest.issues.create({
                owner: <ORG_OWNER>,
                repo: <REPOSITORY>,
                title: 'Stale repo' + repo.url,
                body: 'This repo is stale. Please contact the owner to make it active again.',
              });
              console.log(issue);
            }
          github-token: ${{ secrets.GH_TOKEN }}

Instead of creating the issue in the step. Ask the agent to do a deep research on the stale repository to make sure they are actually stale and produce a more detailled report with an overview of the activity in each report. Post as issue using the sample template as in the action


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Convert stale repo identifier to agentic workflow Convert stale repository identifier to agentic workflow with deep analysis Dec 3, 2025
Copilot AI requested a review from pelikhan December 3, 2025 07:40
- repos
- issues
- pull_requests
bash:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot add edit

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added edit tool in commit e42d92e.

workflow_dispatch:
inputs:
organization:
description: "GitHub organization to scan for stale repositories"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot default is github org

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed default organization to github in commit e42d92e.

schedule:
- cron: "3 2 1 * *" # Monthly on the 1st at 2:03 AM UTC

permissions:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot import python data viz, jq helper

Enable update_assets to show graphs

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added imports for python-dataviz.md and jqschema.md, and enabled upload-assets safe-output in commit e42d92e. The workflow now has full Python data visualization capabilities with matplotlib/seaborn, jq schema discovery utilities, and asset upload support for charts and graphs.

Copilot AI changed the title Convert stale repository identifier to agentic workflow with deep analysis Convert stale repository identifier to agentic workflow with deep analysis and data visualization Dec 3, 2025
Copilot AI requested a review from pelikhan December 3, 2025 07:58
@pelikhan
pelikhan marked this pull request as ready for review December 3, 2025 08:07
@pelikhan
pelikhan merged commit 8228e16 into main Dec 3, 2025
@pelikhan
pelikhan deleted the copilot/convert-to-agentic-workflow branch December 3, 2025 08:07
@github-actions github-actions Bot mentioned this pull request Dec 3, 2025
1 of 2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants