https://github.com/brpaz/github-stars-notion-sync
Command Line tool to sync your GitHub starred repos to a Notion database
https://github.com/brpaz/github-stars-notion-sync
github-stars golang notion
Last synced: 5 months ago
JSON representation
Command Line tool to sync your GitHub starred repos to a Notion database
- Host: GitHub
- URL: https://github.com/brpaz/github-stars-notion-sync
- Owner: brpaz
- License: mit
- Created: 2024-01-07T15:59:54.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-29T03:25:27.000Z (over 1 year ago)
- Last Synced: 2024-06-21T06:28:07.820Z (over 1 year ago)
- Topics: github-stars, golang, notion
- Language: Go
- Homepage:
- Size: 67.4 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
[![github-workflow-shield]][github-workflow-url]
[![Contributors][contributors-shield]][contributors-url]
[![MIT License][license-shield]][license-url]
[![Go Version][gomod]][gomod-url]
GitHub Stars Notion sync
A command line tool to sync your GitHub starred repositories with a Notion database.
Table of Contents
## โน๏ธ About The Project
This project allows to syncronize your starred repositories from GitHub to a Notion database, allowing easily filtering your favorite GitHub using the advanced features of a Notion database.
### Built With
* Golang and [Cobra](https://cobra.dev)
## ๐ Getting Started
### Setup your notion database.
For this integration to work properly, you must create a Notion database with at least the following collumns:
| Field | Type | Description |
|------------------|-----------------|-------------------------------------------------------------------------------------------------|
| Name | text | This field will store the name of the GitHub repository. |
| Description | text | This field will store the description of the GitHub repository. |
| Language | select | This field will store the main language of the GitHub repository. |
| Topics | multi-select | This field will store the topics of the GitHub repository. |
| Repository URL | url | This field will store the URL of the GitHub repository. |
| Repository ID | number | Internal field that will store the repository ID. You can hide it from the table but must not change. It is used to keep track of the already synced repository. |
| Created Time | time | Will keep track of the date this repository was synced. You can also hide it from the table but must not be removed. |
> [!TIP]
> You can have any other collumns in your database. They wonยดt be touched by this command.
You can use [this template](https://brpaz-dev.notion.site/75dd9254235f4577a9d4d259df6a2b64?v=a2ecaa84752c4699b02a982fbb8872a6&pvs=4) to get started.
### Configure notion integration
Next you need to create a Notion API Token and give it access to your database.
1. **Create a Notion integration:** Go to https://www.notion.so/my-integrations and create a new integration. Give it a name like "GitHub stars Syncer" and associate in to the workspace where your database is. Make sure to save the generated token in a Safe place.
2. **Enable integration for your database**: Open your Notion database page, and on the `...` menu at top right, click on "Connections" -> "Add connection" and select the integration you created on 1. This will ensure the integration have access to your database.
3. **Find your database id** - Open your database page in Notion. You should see in your browser an url similar to `https://www.notion.com/fer6ff3d5fcs3dff1d2134349192cc?v=4rf43545..`. Grab the first id. This is your database id. You will need to convert it to UUID format, by splitting the characters with `-`, in the pattern `8-4-4-12`. This example id would be `550e8400-e29b-41d4-a716-446655440000` as uuid.
### Create a GitHub access token.
You will also need a GitHub access token, in order to retrieve your starred repos from GitHub
1. Login in GitHub and open `https://github.com/settings/tokens`
2. Create a new "General token" with `read:user` permission.
### Installation
1. Download the latest release from [GitHub](https://github.com/brpaz/github-stars-notion-sync/releases) for your operating system.
## โถ๏ธ Usage
To sync your GitHub starred repos with your Notion database, run the following command:
```shell
github-stars-notion-sync sync --github-token= --notion-token= --notion-database-id=
```
Instead of using flags to set the command options, you can also use envrionment variables.
Ex:
```shell
GITHUB_TOKEN= NOTION_TOKEN= NOTION_DATABASE_ID= github-stars-notion-sync sync
```
### Run with docker
If you prefer, you can also use Docker.
```shell
docker run --rm \
-e GITHUB_TOKEN= \
-e NOTION_TOKEN= \
-e NOTION_DATABASE_ID= \
ghcr.io/brpaz/github-stars-notion-sync:latest sync
```
## ๐ค Contributing
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement".
Don't forget to give the project a star! Thanks again!
1. Fork the Project
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to the Branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request
## ๐ซถ Support
If you find this project helpful and would like to support its development, there are a few ways you can contribute:
[](https://github.com/sponsors/brpaz)
## ๐ License
Distributed under the MIT License. See [LICENSE](LICENSE.md) file for details.
## ๐ฉ Contact
- Bruno Paz - [https://brunopaz.dev](https://brunopaz.dev) - oss@brunopaz.dev
## ๐
Acknowledgments
* [Anatoly Nosov](https://github.com/jomei) for creating the [Notion API golang client](https://github.com/jomei/notionapi), which helped a lot building this integration.
[contributors-shield]: https://img.shields.io/github/contributors/brpaz/github-stars-notion-sync.svg?style=for-the-badge
[contributors-url]: https://github.com/brpaz/github-stars-notion-sync/graphs/contributors
[license-shield]: https://img.shields.io/github/license/brpaz/github-stars-notion-sync.svg?style=for-the-badge
[license-url]: https://github.com/brpaz/github-stars-notion-sync/blob/main/LICENSE.md
[github-workflow-shield]: https://img.shields.io/github/actions/workflow/status/brpaz/github-stars-notion-sync/ci.yml?style=for-the-badge
[github-workflow-url]: https://github.com/brpaz/github-stars-notion-sync/actions
[gomod]: https://img.shields.io/github/go-mod/go-version/brpaz/github-stars-notion-sync?style=for-the-badge
[gomod-url]: https://github.com/brpaz/github-stars-notion-sync
