Socket
Socket
Sign inDemoInstall

gitlab-ci-variables

Package Overview
Dependencies
1
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    gitlab-ci-variables

Provides typed access to GitLab CI environment variables.


Version published
Weekly downloads
1K
increased by0.9%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

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.

Keywords

FAQs

Last updated on 02 Feb 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc