diff --git a/packages/core/src/services/github.js b/packages/core/src/services/github.js new file mode 100644 index 0000000..26a2394 --- /dev/null +++ b/packages/core/src/services/github.js @@ -0,0 +1,17 @@ +// https://docs.gitlab.com/ce/ci/variables/README.html + +export function detect() { + return !!process.env.GITHUB_ACTIONS +} + +export function config() { + return { + name: 'GitHub Actions', + service: 'github', + build: process.env.GITHUB_RUN_ID, + commit: process.env.GITHUB_SHA, + branch: process.env.GITHUB_HEAD_REF || (process.env.GITHUB_REF && process.env.GITHUB_REF.split('/')[2]), + root: process.env.GITHUB_WORKSPACE, + slug: process.env.GITHUB_REPOSITORY, + } +} diff --git a/packages/core/src/services/index.js b/packages/core/src/services/index.js index cf63248..0763ec0 100644 --- a/packages/core/src/services/index.js +++ b/packages/core/src/services/index.js @@ -5,6 +5,7 @@ import * as circle from './circle' import * as cirrus from './cirrus' import * as codeship from './codeship' import * as drone from './drone' +import * as github from './github' import * as gitlab from './gitlab' import * as heroku from './heroku' import * as jenkins from './jenkins' @@ -28,6 +29,7 @@ export default [ cirrus, codeship, drone, + github, gitlab, jenkins, semaphore,