Keeping GitHub Organizations Free of Dormant Repositories
As an organization grows, so does the number of repositories it manages. Over time, some projects naturally fall out of active development. Leaving these repos in place can be misleading for potential users who may base their adoption decisions on maintenance signals. Archiving a dormant project is a clear, deliberate action that helps keep a public catalog tidy and sets accurate expectations for the community.
The GitHub Open Source Programs Office (OSPO) faced exactly this curation problem internally. To solve it, they built and are now publishing the Stale Repos Action — an open-source tool that scans your organization for repositories with no activity within a configurable time window. The resulting report lets you decide whether a repo deserves archiving, revival, or a redirect of effort. The OSPO's broader tooling and guides are collected in the github-ospo repository.
Setup and Workflow Configuration
To get started, you'll need a repository hosting the workflow itself, since the report is delivered as an issue in that same repo. From there:
- Retrieve the template workflow from the Stale Repos Action repository.
- Set two required environment values as repository secrets:
GH_TOKENandORGANIZATION. The environment values need read access to every repo in the target organization. GitHub's own setup uses a personal access token (classic) with theread:orgscope selected. - Save the workflow file into the
.github/workflows/directory with a.ymlextension (e.g.,.github/workflows/stale_repos.yml).
The sample workflow's default threshold for "stale" is one year. You can adjust this to any positive whole number representing the amount of days since the last push to the default branch.
name: stale repo identifier
on:
workflow_dispatch:
schedule:
- cron: '3 2 1 * *'
jobs:
build:
name: stale repo identifier
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Run stale_repos tool
uses: docker://ghcr.io/github/stale_repos:v1
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
ORGANIZATION: ${{ secrets.ORGANIZATION }}
INACTIVE_DAYS: 365
- name: Create issue
uses: peter-evans/create-issue-from-file@v4
with:
title: Stale repository report
content-filepath: ./stale_repos.md
assignees: <YOUR_GITHUB_HANDLE_HERE>
Once committed, the action fires on whatever schedule you define in the workflow. Each run assesses the target organization and opens a new issue with the findings in the workflow's host repository.
What the Report Contains
The action's output is a Markdown report. For each dormant repository it finds, the report includes the repository URL and the number of days since the default branch received its last push. That summary gives maintainers a focused starting point when deciding which repositories need a closer look or formal archive status.
If you hit a snag or have questions on how to tailor the action to your workflows, the issues tracker is open for input.
GitHub's OSPO plans to keep relying on this tool to guide conversations with maintainers and fine-tune the open-source catalog. For anyone else wrestling with a dusty repository backlog, this action offers a simple way to turn passive downtime into an active stewardship decision.



