From 92539624aaedb3d2a87e66e00c0f228eb84df709 Mon Sep 17 00:00:00 2001 From: Gar Date: Thu, 10 Nov 2022 09:36:53 -0800 Subject: [PATCH] fix: github actions github actions currently sets (at least) two variables, but one definitely seems like the "right" one to check to see if you are indeed in github actions. ``` GITHUB_ACTION=__run GITHUB_ACTIONS=true ``` Thanks to @bdehamer for helping look into this --- lib/index.js | 2 +- test/index.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/index.js b/lib/index.js index 34755c7..0aa6359 100644 --- a/lib/index.js +++ b/lib/index.js @@ -11,7 +11,7 @@ module.exports = () => : process.env.SEMAPHORE ? 'semaphore' : process.env.DRONE ? 'drone' : process.env.DSARI ? 'dsari' - : process.env.GITHUB_ACTION ? 'github-actions' + : process.env.GITHUB_ACTIONS ? 'github-actions' : process.env.TDDIUM ? 'tddium' : process.env.SCREWDRIVER ? 'screwdriver' : process.env.STRIDER ? 'strider' diff --git a/test/index.js b/test/index.js index 2883e5b..37377a3 100644 --- a/test/index.js +++ b/test/index.js @@ -19,7 +19,7 @@ const env = (t, key, val) => { } // our own CI runs in github actions so start with turning these off -env(t, 'GITHUB_ACTION', '') +env(t, 'GITHUB_ACTIONS', '') env(t, 'CI', '') // delete to verify that heroku test doesn't bork if node env missing env(t, 'NODE', '') @@ -37,7 +37,7 @@ test('GITLAB_CI', '1', 'gitlab') test('CIRCLECI', '1', 'circle-ci') test('SEMAPHORE', '1', 'semaphore') test('DRONE', '1', 'drone') -test('GITHUB_ACTION', '1', 'github-actions') +test('GITHUB_ACTIONS', 'true', 'github-actions') test('TDDIUM', '1', 'tddium') test('JENKINS_URL', '1', 'jenkins') test('WERCKER', '1', 'wercker')