From 9413e5453dd98acd9fe8b355ff1267520b0209e4 Mon Sep 17 00:00:00 2001 From: Tu Nguyen Date: Mon, 28 Aug 2023 08:51:57 -0700 Subject: [PATCH 1/2] Update README.md --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index b722a37..746bac3 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,13 @@ # GitHub data scraper +## Setup + +Set environment variables for `github` CLI. + +```shell +export GITHUB_TOKEN= +``` + ## Releases Retrieve releases created in the repository: From ed5c6bbd2e1a17eb4c75204a78e0bfc929e0c2e0 Mon Sep 17 00:00:00 2001 From: Tu Nguyen Date: Mon, 28 Aug 2023 09:04:17 -0700 Subject: [PATCH 2/2] update to quickstart guide --- README.md | 25 +++++++++++++++++++++++-- scripts/init-database.sh | 2 +- 2 files changed, 24 insertions(+), 3 deletions(-) mode change 100644 => 100755 scripts/init-database.sh diff --git a/README.md b/README.md index 746bac3..c63c299 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,32 @@ # GitHub data scraper -## Setup +## Quickstart -Set environment variables for `github` CLI. +Set environment variables for `github` CLI and postgres. ```shell export GITHUB_TOKEN= +export POSTGRES_USER=user +export POSTGRES_PASSWORD=password +export POSTGRES_DB=database +``` + +Build binary. + +```shell +go build -v -o dist/github . +``` + +Start local database. + +```shell +make +``` + +Start local database. + +```shell +./dist/github issues -f sql -o postgres://user:password@localhost:5432/database hashicorp consul ``` ## Releases diff --git a/scripts/init-database.sh b/scripts/init-database.sh old mode 100644 new mode 100755 index 2af308a..8f4b9b5 --- a/scripts/init-database.sh +++ b/scripts/init-database.sh @@ -225,5 +225,5 @@ CREATE TABLE IF NOT EXISTS github_metrics_referrers ( PRIMARY KEY (repository, owner, referrer, date) ); -GRANT ALL ON ALL TABLES IN SCHEMA "public" TO $POSTGRES_USER; +GRANT ALL ON ALL TABLES IN SCHEMA "public" TO "$POSTGRES_USER"; EOSQL \ No newline at end of file