github-lang-box
v1.0.6
Published
Update a pinned gist to show your most used programming languages
Downloads
66
Readme
github-lang-box
Fork of lang-stats-box with some customizations:
- Updated dependencies
- Published to npm, Added binary for use with
npx
orpnpm dlx
- Use
/user/repos
endpoint to fetch all repos of the user (including private repos) - Custom
description
Note: Due to the use of
/user/repos
endpoint, the Fine-grained access tokens must have themetadata:read
permission.
Setup
Prep work
- Create a new public GitHub Gist (https://gist.github.com/)
- Create an access token with the
gist
andmetadata:read
scopes and copy it.(https://github.com/settings/tokens?type=beta)
Project setup
- Copy this workflow file to your repo's
.github/workflows
directory. - Go to the repo Settings > Secrets
- Add the following environment variables:
- GH_TOKEN: The GitHub access token generated above.
- GIST_ID: The ID portion from your gist url:
https://gist.github.com/Aveek-Saha/
8335e85451541072dd25fda601129f7d
. - GH_USERNAME: Your
GitHub
account username. - EXCLUDE: A comma separated list of languages you want to exclude from the gist. Eg: Jupyter Notebook, CSS, TeX, PHP
- EXCLUDE_REPO: A comma separated list of repositories you want to exclude from the gist. Eg: username/repo1, username/repo2
- DESCRIPTION: A custom description for the gist.
Use as a CLI
Add environment variables to .env
file or export them in the shell, then run:
npx github-lang-box@1
# or
# pnpm dlx github-lang-box@1
Additionally, you can use these commands in your GitHub Actions with a Node.js runtime. Refer to the this workflow file.
Credits
This code was inspired by @matchai's bird-box.
This is a fork of @Aveek-Saha's lang-stats-box.