Built and signed on GitHub ActionsBuilt and signed on GitHub Actions
Built and signed on GitHub Actions
latest
bearz-io/js-ci-envUtilities for writing scripts for continuous integration pipelines such as Github or Azure Devops logging commands.
This package works with Node.js, Deno, BunIt is unknown whether this package works with Cloudflare Workers, Browsers




JSR Score
100%
Published
9 months ago (0.1.0)
Overview
The ci-env module implements it's own @bearz/ansi/writer to enable
logging commands for Azure DevOps and Github.
This module will evolve over time to enable using common ci environment variables and make it easier to deal with secrets, environment variables and outputs in ci pipelines.

Documentation
Documentation is available on jsr.io
A list of other modules can be found at github.com/bearz-io/js
Usage
import { writer, CI, CI_DRIVER , setCiVariable } from "@bearz/ci-env"; // if not using azure devops/github, the write falls back to using ansi codes. // when using azure devops/github, the writer will use azure devops logging commands // or github workflow commands where possible. writer.info("message"); writer.warn("warning"); // for azure devops/github this emits a warnning logging command writer.error("test"); // for azure devops/github this emits a warnning logging command // for azure devops/github this emits a commmand logging command. // this does not executing a command, but simply outputs it. writer.command("git", ["commit", "-a", "-m", "test") console.log(CI); // outputs if running in a CI pipeline console.log(CI_DRIVER); // outputs the CI Driver name. // in github, azure devops, this uses GITHUB_ENV or ##vso[task.setvariable variable=TEST]one // Outside of github/azure devops, it uses the BEARZ_CI_ENV variable which must be a // file path. setCiVariable will write // values to that file path which can be loaded by calling `loadCiEnvVars`. However its // up to you to manage how you store the path from BEARZ_CI_ENV. setCiVariable("TEST", "one"); setCiVariable("SECRET", "my pw", { secret: true});
License
Built and signed on
GitHub Actions
Add Package
deno add jsr:@bearz/ci-env
Import symbol
import * as ci_env from "@bearz/ci-env";
Import directly with a jsr specifier
import * as ci_env from "jsr:@bearz/ci-env";
Add Package
pnpm i jsr:@bearz/ci-env
pnpm dlx jsr add @bearz/ci-env
Import symbol
import * as ci_env from "@bearz/ci-env";
Add Package
yarn add jsr:@bearz/ci-env
yarn dlx jsr add @bearz/ci-env
Import symbol
import * as ci_env from "@bearz/ci-env";
Add Package
vlt install jsr:@bearz/ci-env
Import symbol
import * as ci_env from "@bearz/ci-env";
Add Package
npx jsr add @bearz/ci-env
Import symbol
import * as ci_env from "@bearz/ci-env";
Add Package
bunx jsr add @bearz/ci-env
Import symbol
import * as ci_env from "@bearz/ci-env";