diff --git a/README.md b/README.md index b722a37..c63c299 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,34 @@ # GitHub data scraper +## Quickstart + +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 Retrieve releases created in the repository: 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