You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
gh extension to count the number of PRs with the same label as the directory name for monorepo
Motivation
Suppose you are a monorepo user and want to know the statistics of which services are actively developed.
You assume that each Pull Request has a label with the name of the directory that contains the files changed by the Pull Request.
gh-monorepo-pr-count will count a number of PR by label for each directory in your monorepo.
Usage of ./gh-monorepo-pr-count:
-debug-url
Optional: Print debug url
-since string
Required: Search PRs merged since this date. Format: yyyy-mm-dd
-uniq-author
Optional: Count a number of PR for each directory by uniq author
-until string
Optional: Search PRs merged until this date. Format: yyyy-mm-dd (default is today)
Output example:
backend,54
docs,20
frontend,10
Please note that the order of the output is not guaranteed. You can sort the output by sort command to get the consistent result.
Environment Variables
Name
Description
GH_REPO
The repository to query. Defaults to the current repository.
SEARCH_QUERY
The search query to use. If you exclude a PR with dependencies label and by bot, set "-label:dependencies -author:app/my-cool-bot"
MAX_CONCURRENCY
The maximum number of concurrentcy. Defaults to 50.
Known limitations
Only the first 100 search results are available
gh list command returns only the first 100 results. Set the environment variable SEARCH_QUERY or change the 'since' argument to return less than 100 results.
About
gh extension to count the number of PRs with the same label as the directory name