Merge pull request #13352 from jamessan/isCI

test: Add GitHub actions support to helpers.isCI
This commit is contained in:
James McCoy 2020-11-22 15:35:09 -05:00 committed by GitHub
commit 5705bb1250
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -777,11 +777,12 @@ end
function module.isCI(name)
local any = (name == nil)
assert(any or name == 'appveyor' or name == 'travis' or name == 'sourcehut')
assert(any or name == 'appveyor' or name == 'travis' or name == 'sourcehut' or name == 'github')
local av = ((any or name == 'appveyor') and nil ~= os.getenv('APPVEYOR'))
local tr = ((any or name == 'travis') and nil ~= os.getenv('TRAVIS'))
local sh = ((any or name == 'sourcehut') and nil ~= os.getenv('SOURCEHUT'))
return tr or av or sh
local gh = ((any or name == 'github') and nil ~= os.getenv('GITHUB_ACTIONS'))
return tr or av or sh or gh
end