Skip to content

Organization activity

What moved in an organization lately: pull requests opened and merged, issues opened and closed, and — for the asking — discussions opened and commits authored. The window is an option and the title says what it is, so the card reads as a rolling report rather than a total that only ever grows. The organization activity card

?org=forge-guild&days=30&show=commits
OptionWhat it is
orgThe organization’s login — the name in github.com/<org>
OptionValuesWhat it does
days1 to 365Days the window covers (30 by default)
froma year, a month or a dayThe start of the window, instead of days
toa year, a month or a dayThe end of the window, instead of days
showdiscussions_started commitsDraw these stats as well
hideprs_opened prs_merged issues_opened issues_closedLeave these stats out
show_iconstrue falseShow an icon beside each stat (on by default)

show and hide each take any stat the card draws; a stat named in both is left out.

Plus the common options.

days counts back from today, both ends inclusive — so the default 30 is today and the 29 days before it, and days=1 is today alone. It rolls: the card drawn tomorrow covers tomorrow.

from and to name a fixed window instead — ?from=2024&to=2024 is the whole of 2024, and the title says so. Either end may be left open: to then means today, and from the 30 days before to. A query naming days as well as either is an error.

Every end is a UTC date, which is all GitHub’s search qualifiers read. A card rendered just after midnight UTC therefore counts a today that has barely started.

Each one is a search over the window, and each asks a different question of it — so they do not add up, and none of them is a subset of another:

  • PRs opened were created in the window, whether or not they are still open.
  • PRs merged were merged in the window, whenever they were opened.
  • Issues opened were created in the window; issues closed were closed in it.
  • Discussions opened counts discussions created across the organization’s repositories.
  • Commits are commits authored in the window, by author date rather than push date.

A pull request opened in March and merged in April is counted by neither figure of a window covering only May, and by both figures of one covering both months.

The issue rows need a token that can read issues: a classic token with the repo scope, or see the organization cards for the others. GitHub answers a token refused issues with pull requests, so the card checks what the search matched and draws an error rather than two rows of pull request counts. Hide both rows to draw the rest of the card from such a token:

?org=ORG_NAME&hide=issues_opened,issues_closed

GitHub’s GraphQL search cannot search commits, so show=commits adds a REST commit search: a second request, against a much smaller allowance than the rest of the card uses. Everything else rides on one GraphQL request and one rate-limit point, whatever show and hide leave on the card.

Where that search is refused, the commits row is left out and the rest of the card still renders.

A search answers what its token can find: a token that reads the organization’s private repositories counts those too, so two deployments can draw different numbers for one organization.