all-contributors-for-repository

Generates an allcontributors list for an existing repository. ๐Ÿค

MIT 22 ไธช็‰ˆๆœฌ
ๅฎ‰่ฃ…
npm install all-contributors-for-repository
yarn add all-contributors-for-repository
pnpm add all-contributors-for-repository
bun add all-contributors-for-repository
README

All Contributors For Repository

Generates an allcontributors list for an existing repository. ๐Ÿค

Usage

npm i all-contributors-for-repository
import { getAllContributorsForRepository } from "all-contributors-for-repository";

const contributors = await getAllContributorsForRepository({
	owner: "JoshuaKGoldberg",
	repo: "create-typescript-app",
});

/*
{
  john_reilly: [ 'bug', 'code' ],
  joshuakgoldberg: [ 'maintenance', 'tool' ],
}
*/
console.log(contributors);

Warning This tool only sees contributions that can be detected from the last 500 events in GitHub's API. Don't forget to manually add in other forms of contributions!

The types of contributions detected from the GitHub API are:

  • ๐Ÿ› bug: anybody who filed an issue labeled as accepting PRs and a bug (see Options)
  • ๐Ÿ“– doc: authors of merged PRs that address issues labeled as accepting PRs and docs (see Options)
  • ๐Ÿšง maintenance: adding labels to issues and PRs, and merging PRs
  • ๐Ÿ‘€ review: submitting a review for a PR
  • ๐Ÿ”ง tool: authors of merged PRs that address issues labeled as accepting PRs and tooling (see Options)

Additionally, based on PR conventional commit titles in the Angular convention, for all PR authors and co-authors:

  • build and ci: will be treated as an :infra: contribution
  • docs: will be treated as an :doc: contribution
  • test: will be treated as an :test: contribution
  • All other PRs -including those without a conventional title- will be treated as :code: contributions

๐Ÿ’ก Given that list of contributors, you might want to run all-contributors add on each contributor & contribution type.

import { $ } from "execa";

for (const [contributor, contributions] of Object.entries(contributors)) {
	const contributionTypes = Object.keys(contributions).join(",");
	await $`npx all-contributors add ${contributor} ${contributionTypes}`;
}

See populate-all-contributors-for-repository for a project that does just that. ๐Ÿ“‹

Options

The exported getAllContributorsForRepository function takes in an object with two required properties:

  • owner (string): The owner of the repository to query, such as "JoshuaKGoldberg".
  • repository (string): The name of the repository to query, such as "all-contributors-for-repository".

It additionally allows for the following optional options.

  • auth (string): GitHub auth token to query the API with, if necessary for private repositories and/or to avoid rate limiting.
  • ignoredLogins (RegExp[]): Regular expressions for usernames to ignore commits from, such as bot users.
    • Default: [/\[bot\]$/i, /^allcontributors$/i, /^copilot$/i, /^dependabot$/i, /^renovate$/i]
  • labelAcceptingPrs (string): Label to indicate an issue is accepting pull requests.
  • labelTypeBug (string): Label to indicate an issue is for a bug.
  • labelTypeDocs (string): Label to indicate an issue is for documentation.
  • labelTypeIdeas (string): Label to indicate an issue is for a feature.
  • labelTypeTool (string): Label to indicate an issue is for tooling.
import { getAllContributorsForRepository } from "all-contributors-for-repository";

getAllContributorsForRepository({
	auth: "abc123",
	ignoredLogins: [/-it$/i],
	labelAcceptingPrs: "help wanted",
	labelTypeBug: "bug",
	labelTypeDocs: "docs",
	labelTypeIdeas: "feature",
	labelTypeTool: "tool",
});

Development

See .github/CONTRIBUTING.md, then .github/DEVELOPMENT.md. Thanks! ๐Ÿค

Contributors

Fabian De La Peรฑa Montero
Fabian De La Peรฑa Montero

๐Ÿ“–
Josh Goldberg
Josh Goldberg

๐Ÿ› ๐Ÿ’ป ๐Ÿ–‹ ๐Ÿ“– ๐Ÿค” ๐Ÿš‡ ๐Ÿšง ๐Ÿ“† โš ๏ธ ๐Ÿ”ง
Navin Moorthy
Navin Moorthy

๐Ÿ›

๐Ÿ’ This package was templated with create-typescript-app using the Bingo framework.

็‰ˆๆœฌๅˆ—่กจ
0.5.1 2026-06-30
0.5.0 2026-06-19
0.4.0 2024-12-16
0.3.1 2024-12-13
0.3.0 2024-08-10
0.2.3 2024-08-10
0.2.2 2024-01-12
0.2.1 2023-11-27
0.2.0 2023-11-27
0.1.1 2023-11-26
0.1.0 2023-08-24
0.0.11 2023-08-24
0.0.10 2023-06-11
0.0.9 2023-06-11
0.0.8 2023-05-10
0.0.7 2023-05-09
0.0.6 2023-05-09
0.0.5 2023-05-01
0.0.4 2023-05-01
0.0.3 2023-05-01
0.0.2 2023-05-01
0.0.1 2023-05-01