From 48b5b8e740708e8bf770ae44cccc95fb551f214c Mon Sep 17 00:00:00 2001 From: Benjamin Lupton Date: Mon, 11 Nov 2019 01:40:30 +0800 Subject: [PATCH] v1.9.0 - add support for GITHUB_API env var --- .travis.yml | 3 +-- HISTORY.md | 4 ++++ package-lock.json | 2 +- package.json | 4 ++-- source/lib/projectz.js | 5 ++++- 5 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9306a76a..f11a57d9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,6 @@ node_js: - '8' - '10' - '12' -- '13' matrix: fast_finish: true allow_failures: [] @@ -18,4 +17,4 @@ after_success: notifications: email: recipients: - secure: f6/szRoj5YocIDXfVpJii+v6hBtHGQR90gx9mZQBhy+tW5wbiQhpOh8eMl59CUFCyzG2hENL+qrHvmFlE6mwi14cTGAXP/XovKotzb59Ftib/uwhl6cApSh51H0CkTr8Lvvre0DelklAHXLaASywd0i+iPCKnVvc5wUuRRyQP+A= + secure: DYTnnnxuSukbdU2tZpuc90wb4f4kce3scGLub8IYM4PBGuQUryIp6IbcnyZnIuikjKuORGrOjtog/y7zSdiTTkaZg90ChX/eLA3BpPiYkSU+snvk8+m2BjNg2UjTzMsvSHZslIUHWE5KuD81PEKV99QtOQ9oRncV6615koJrfW8= diff --git a/HISTORY.md b/HISTORY.md index 32d77ff0..f03cad9e 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,5 +1,9 @@ # History +## v1.9.0 2019 November 11 + +- Implemented support for `GITHUB_API` environment variable to access the GitHub API via a proxy + ## v1.8.0 2019 November 11 - Updated [base files](https://github.com/bevry/base) and [editions](https://editions.bevry.me) using [boundation](https://github.com/bevry/boundation) diff --git a/package-lock.json b/package-lock.json index e5c53a3d..9829d49b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "projectz", - "version": "1.8.0", + "version": "1.9.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 1d8f5880..faa3a2ca 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "title": "Projectz", "name": "projectz", - "version": "1.8.0", + "version": "1.9.0", "description": "Stop wasting time syncing and updating your project's README and Package Files!", "homepage": "https://github.com/bevry/projectz", "license": "MIT", @@ -98,7 +98,7 @@ "flow type comments" ], "engines": { - "node": "8 || 10 || 12 || 13", + "node": "8 || 10 || 12", "browsers": false } } diff --git a/source/lib/projectz.js b/source/lib/projectz.js index 60a661a8..3e139286 100644 --- a/source/lib/projectz.js +++ b/source/lib/projectz.js @@ -43,6 +43,9 @@ const installUtil = require('./install-util.js') const licenseUtil = require('./license-util.js') const projectzUtil = require('./projectz-util.js') +// Allow the user to make use of a proxy service for the github API if they wish +const ghapi = process.env.GITHUB_API || 'https://api.github.com' + // Definition // Projects is defined as a class to ensure we can run multiple instances of it class Projectz { @@ -182,7 +185,7 @@ class Projectz { // Prepare const githubSlug = this.mergedPackageData.github.slug const githubAuthQueryString = fetchGithubAuthQueryString() - const url = `https://api.github.com/repos/${githubSlug}/contributors?per_page=100&${githubAuthQueryString}` + const url = `${ghapi}/repos/${githubSlug}/contributors?per_page=100&${githubAuthQueryString}` // Fetch the github and package contributors for it log('info', `Loading contributors for repository: ${githubSlug}`)