From 1d2fad0a13720b12ee9c3e240d0c8c55afda028a Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Thu, 24 Feb 2022 09:55:01 -0600 Subject: [PATCH] chore: PR feedback Use ci-info package here instead! Feedback: https://github.com/readmeio/rdme/pull/446#discussion_r813558777 Co-Authored-By: Jon Ursenbach --- package-lock.json | 7 +++---- package.json | 1 + src/lib/isGitHub.js | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0ebf20ea5..8c39f718f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,6 +11,7 @@ "dependencies": { "@actions/core": "^1.6.0", "chalk": "^4.1.2", + "ci-info": "^3.3.0", "cli-table": "^0.3.1", "command-line-args": "^5.2.0", "command-line-usage": "^6.0.2", @@ -2824,8 +2825,7 @@ "node_modules/ci-info": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.3.0.tgz", - "integrity": "sha512-riT/3vI5YpVH6/qomlDnJow6TBee2PBKSEpx3O32EGPYbWGIRsIlGRms3Sm74wYE1JMo8RnO04Hb12+v1J5ICw==", - "dev": true + "integrity": "sha512-riT/3vI5YpVH6/qomlDnJow6TBee2PBKSEpx3O32EGPYbWGIRsIlGRms3Sm74wYE1JMo8RnO04Hb12+v1J5ICw==" }, "node_modules/cjs-module-lexer": { "version": "1.2.2", @@ -12118,8 +12118,7 @@ "ci-info": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.3.0.tgz", - "integrity": "sha512-riT/3vI5YpVH6/qomlDnJow6TBee2PBKSEpx3O32EGPYbWGIRsIlGRms3Sm74wYE1JMo8RnO04Hb12+v1J5ICw==", - "dev": true + "integrity": "sha512-riT/3vI5YpVH6/qomlDnJow6TBee2PBKSEpx3O32EGPYbWGIRsIlGRms3Sm74wYE1JMo8RnO04Hb12+v1J5ICw==" }, "cjs-module-lexer": { "version": "1.2.2", diff --git a/package.json b/package.json index 7a03f5ce2..222dd72a5 100644 --- a/package.json +++ b/package.json @@ -35,6 +35,7 @@ "dependencies": { "@actions/core": "^1.6.0", "chalk": "^4.1.2", + "ci-info": "^3.3.0", "cli-table": "^0.3.1", "command-line-args": "^5.2.0", "command-line-usage": "^6.0.2", diff --git a/src/lib/isGitHub.js b/src/lib/isGitHub.js index a8c9fb102..9b6c3bcd4 100644 --- a/src/lib/isGitHub.js +++ b/src/lib/isGitHub.js @@ -3,5 +3,6 @@ * @link https://docs.github.com/en/actions/learn-github-actions/environment-variables#default-environment-variables */ module.exports = function isGHA() { - return process.env.GITHUB_ACTIONS === 'true'; + // eslint-disable-next-line global-require + return require('ci-info').GITHUB_ACTIONS; };