Skip to content

⭐Create a searchable view of your github stars. Runs daily with github actions.

License

Notifications You must be signed in to change notification settings

wlamason/github-stars

Repository files navigation

github-stars

License

⭐Create a searchable view of your github stars. Runs daily with github actions.

Click here for an example.

Basic Usage

python3 github_stars.py

Additional Options

python3 github_stars.py --help
usage: github_stars.py [-h] [-v] [-f FILENAME] [-j] [-jf JSON_FILENAME] username

Create markdown file showcasing a user's github stars.

positional arguments:
  username              User to extract stars from.

optional arguments:
  -h, --help            show this help message and exit
  -v, --verbose
  -f FILENAME, --filename FILENAME
                        Output markdown filename.
  -j, --json            Write json file with starred repo data.
  -jf JSON_FILENAME, --json-filename JSON_FILENAME
                        Output json filename.

Overriding Default Output

To override default output behavior, you can supply an overrides.json file. See overrides.json for an example. overrides.template.json is supplied as an empty template.

Attributes in overrides.json:

  • hidden_languages: A list of programming languages to exclude from output.
  • hidden_repos: A list of repos to exclude from output. Format is <user>/<repo>.
  • overrides: Key value pairs of repo in <user>/<repo> format to object. The object contains key value pairs that override the Repo class in github_stars.py.

Running via Github Actions

This repo was created for personal use. As such, external usage is slightly convoluted. Feel free to raise a github issue if you would like to use this code, and I will make the github action more generic. Otherwise I recommend:

  1. Fork this repo in the top right corner of the webpage
  2. git clone git@github.com:<your_user_name>/github-stars.git
  3. cd github-stars
  4. cp overrides.template.json overrides.json
  5. Update overrides.json with any overrides
  6. git add .
  7. git commit -m "personal github-stars"
  8. git push
  9. On your fork, go to repository settings > Security > Secrets > Actions
  10. Add the repository secret GIT_TOKEN

The value of GIT_TOKEN should be set to a personal access token. I recommend creating a new one just for this app. The access token will have to be updated each time it expires. To create a personal access token:

  1. Click your user icon in the top right > Settings
  2. Click Developer settings
  3. Click Personal access tokens
  4. Click Generate new token

Running Locally

  1. python3 -m venv venv
  2. . venv/bin/activate
  3. python3 -m pip install -r requirements.txt
  4. python3 github_stars.py --help

Generating New Requirements Files

  1. . venv/bin/activate
  2. python3 -m pip install pip-tools
  3. pip-compile -o requirements.txt pyproject.toml
  4. pip-compile --extra dev -o dev-requirements.txt pyproject.toml

Author

👤 Will Lamason

Show your support

Give a ⭐️ if this project helped you!

📝 License

Copyright © 2022 Will Lamason.
This project is Apache--2.0 licensed.


This README was generated with ❤️ by readme-md-generator

About

⭐Create a searchable view of your github stars. Runs daily with github actions.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages