Fills in missing allcontributors entries for a repository. πͺ
This action will:
- Ask
all-contributors-for-repositoryto collect the current repository's contributors - Post
@all-contributors addbot comments in the newest issues and PRs for each contributor
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!
For example, the following job will run on every push to main:
# .github/workflows/contributors.yml
name: Contributors
on:
push:
branches:
- main
permissions:
contents: read
issues: write
pull-requests: write
jobs:
contributors:
runs-on: ubuntu-latest
steps:
- uses: JoshuaKGoldberg/all-contributors-auto-action@v0.7.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}...and will post comments like the following automatically:
@all-contributors please add JoshuaKGoldberg for code.
π€ Beep boop! This comment was added automatically by all-contributors-auto-action.
Not all contributions can be detected from Git & GitHub alone. Please comment any missing contribution types this bot missed.
...and of course, thank you for contributing! π
The action reads its GitHub token from the GH_TOKEN or GITHUB_TOKEN environment variable.
See get-github-auth-token for more details.
It uses that token to:
- Read the repository's issues, pull requests, commits, and events to detect contributions
- Read the repository's
.all-contributorsrcfile to see which contributors are already recorded - Post
@all-contributorscomments on issues and pull requests
The workflow's built-in secrets.GITHUB_TOKEN works as long as the job is granted these permissions:
permissions:
contents: read
issues: write
pull-requests: writeAlternately, you can use a fine-grained personal access token stored as a repository secret. Grant it these repository permissions:
- Contents: Read-only
- Issues: Read and write
- Pull requests: Read and write
- Metadata: Read-only (selected automatically)
A classic personal access token needs the public_repo scope for public repositories, or the repo scope for private repositories.
Then pass it to the action instead of secrets.GITHUB_TOKEN:
- uses: JoshuaKGoldberg/all-contributors-auto-action@v0.7.0
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}RegExp patterns to use for omitting sets of logins (e.g. dependabot).
The action will not attempt to add these users as contributors.
Powered by all-contributors-for-repository, which comes with its own set of reasonable defaults (e.g. \[bot\]$).
All patterns will be used to create RegExp with case-insensitive matching.
# .github/workflows/contributors.yml
name: Contributors
on:
push:
branches:
- main
permissions:
contents: read
issues: write
pull-requests: write
jobs:
contributors:
runs-on: ubuntu-latest
steps:
- uses: JoshuaKGoldberg/all-contributors-auto-action@v0.7.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
ignored-logins: |
-admin$
-it$How far back to look for contributions.
Defaults to auto.
auto: Look back to when the workflow's previous successful run started, so repeated runs don't re-request contributions they've already seen. This requires the job to have theactions: readpermission. If there is no previous successful run, or it can't be determined, all available history is used.all: Look at all available history.- An ISO 8601 date, such as
2026-01-01, or a duration such as12h,7d, or2w.
Only the contributions made since that time are requested from GitHub. This makes each run faster and cheaper in API requests, especially on busy repositories.
A contributor's older contributions won't be seen by a windowed run, though. To also catch anything a windowed run missed, consider running a full scan on a schedule alongside the windowed runs:
# .github/workflows/contributors.yml
name: Contributors
on:
push:
branches:
- main
schedule:
- cron: "0 0 * * 0"
permissions:
actions: read
contents: read
issues: write
pull-requests: write
jobs:
contributors:
runs-on: ubuntu-latest
steps:
- uses: JoshuaKGoldberg/all-contributors-auto-action@v0.7.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
since: ${{ github.event_name == 'schedule' && 'all' || 'auto' }}See .github/CONTRIBUTING.md, then .github/DEVELOPMENT.md.
Thanks! πͺ
Fabian De La PeΓ±a Montero π |
John Reilly π€ |
Josh Goldberg π§ π» π π π€ π π§ π |
doudou0720 π |
michael faith π π€ |
π This package was templated with
create-typescript-appusing the Bingo engine.