0.1.1 • Published 1 year ago

@hankei6km/reposition v0.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

reposition

reposition is a command line tool to send a repository list to Notion database.

Requirement

  • GitHub CLI with authenticated to GitHub
  • Notion Database
  • Notion Integration

Install

npm install -g @hankei6km/reposition

Setup

Create a database with following properties in Notion workspace.

nametype
titletitle
nametext
ownertext
urlurl
descriptiontext
repositoryTopicsmulti_select
createdAtdate
updatedAtdate
pushedAtdate

Usage

$ export REPOSITION_API_KEY=<Integration API KEY>
$ export REPOSITION_DATABASE_ID=<Database Id>
$ gh repo list \
  --json nameWithOwner,name,owner,url,description,repositoryTopics,createdAt,updatedAt,pushedAt,openGraphImageUrl \
  --jq .[] | reposition

Add -L option to gh if you hava many repositories.

$ gh repo list -L 50 \
  --json nameWithOwner,name,owner,url,description,repositoryTopics,createdAt,updatedAt,pushedAt,openGraphImageUrl \
  --jq .[] | reposition

When updating the database, use the --filter-time-range option to reduce the number of repositories to be send.

$ gh repo list -L 50 \
  --json nameWithOwner,name,owner,url,description,repositoryTopics,createdAt,updatedAt,pushedAt,openGraphImageUrl \
  --jq .[] | reposition --filter-time-range 172800 # repositories updated(pushed) within 2 days.

Note: reposition does not have the function to remove pages from the database.

License

MIT License

Copyright (c) 2023 hankei6km