Leaderboard github plugin
Add the plugin to your config.yaml:
leaderboard:
plugins:
github:
source: "@ohcnetwork/leaderboard-github-plugin"
config:
githubOrg: ${{ env.GITHUB_ORG }}
# Single token (basic):
githubToken: ${{ env.GITHUB_TOKEN }}
# Multiple tokens (recommended for large orgs to avoid rate limits):
# githubTokens:
# - ${{ env.GITHUB_TOKEN_1 }}
# - ${{ env.GITHUB_TOKEN_2 }}
# - ${{ env.GITHUB_TOKEN_3 }}| Option | Type | Required | Description |
|---|---|---|---|
githubOrg |
string |
Yes | GitHub organization name |
githubToken |
string |
Yes* | A single GitHub personal access token |
githubTokens |
string[] |
Yes* | Array of GitHub tokens for rotation on rate limit |
* At least one of githubToken or githubTokens must be provided. When multiple tokens are supplied, the plugin automatically rotates to the next available token when one hits GitHub's rate limit, instead of waiting an hour.
The plugin saves progress after each repository is scraped. If the process fails mid-way:
- Automatic resume: Rerun the scrape and already-completed repos are skipped.
- Progress tracking: Check
scrape-status.mdin your data directory for a live status table. - Reset: Delete
.scrape-progress.jsonfrom your data directory to force a full rescrape.
- Build the plugin:
pnpm build-
Add the plugin to your
config.yaml(see Configuration above) -
Run the plugin runner:
pnpm data:scrape# Build the plugin
pnpm build
# Run tests
pnpm test
# Watch mode
pnpm test:watchThis package uses changesets for version management and automated publishing to GitHub's npm registry.
When making changes that should be included in the next release:
- Make your code changes
- Run
pnpm changesetto create a changeset file - Select the type of change (major, minor, or patch)
- Describe your changes in the prompt
- Commit the generated changeset file along with your changes
pnpm changeset
git add .changeset/
git commit -m "feat: your feature description"The release process is automated via GitHub Actions:
- When PRs with changesets are merged to
main, a "Version Packages" PR is automatically created/updated - Review the Version Packages PR to verify:
- Version bumps are correct
- CHANGELOG entries are accurate
- Merge the Version Packages PR to automatically publish to GitHub's npm registry
If you need to publish manually:
pnpm build
pnpm releaseNote: You'll need to be authenticated with GitHub's npm registry and have the appropriate permissions.
To install this package from GitHub's npm registry:
- Create or update your
.npmrcfile:
@ohcnetwork/leaderboard-github-plugin:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=${GITHUB_TOKEN}
- Install the package:
npm install @ohcnetwork/leaderboard-github-pluginMIT