0.1.0 • Published 7 years ago
gitlab-ci-variables v0.1.0
GitLab CI Variables
A package which parses the predefined variables set by GitLab CI, providing a structured object (with TypeScript definitions) representing the data from the environment.
Installation
npm install gitlab-ci-variables
Usage
import loadVariables, { isGitLabCI } from 'gitlab-ci-variables';
if (isGitLabCI()) {
console.log('Running under GitLab CI runner');
}
const variables = loadVariables();
// variables === undefined iff !isGitLabCI()
if (variables) {
console.log(`Build (ID ${variables.build.id}) of ${variables.project.name}. Started by ${variables.user.email}.`);
}
See the packaged TypeScript definitions for a full list of properties. Alternatively, see the Variables
interface in the source code.
0.2.0-dev.6249357
7 years ago
0.1.0
7 years ago
0.1.0-dev.6246386
7 years ago
0.1.0-dev.6231021
7 years ago
0.1.0-dev.4847497
8 years ago
0.1.0-dev.4847364
8 years ago