@percy/env

This package provides various CI/CD support for Percy by coalescing different environment variables into a common interface for consumption by `@percy/client`.

Usage no npm install needed!

<script type="module">
  import percyEnv from 'https://cdn.skypack.dev/@percy/env';
</script>

README

@percy/env

This package provides various CI/CD support for Percy by coalescing different environment variables into a common interface for consumption by @percy/client.

Supported Environments

Percy Environment Variables

The following variables may be defined to override the respective derived CI environment variables.

PERCY_COMMIT          # build commit sha
PERCY_BRANCH          # build branch name
PERCY_PULL_REQUEST    # associated PR number
PERCY_PARALLEL_NONCE  # parallel nonce unique for this CI workflow
PERCY_PARALLEL_TOTAL  # total number of parallel shards

Additional Percy specific environment variable may be set to control aspects of your Percy build.

PERCY_TARGET_COMMIT   # percy target commit sha
PERCY_TARGET_BRANCH   # percy target branch name
PERCY_PARTIAL_BUILD   # if this build was marked as partial

Adding Environment Support

  1. Add CI detection to environment.js
  2. Add respective environment variables
  3. Add a dedicated CI test suite
  4. Open a Pull Request!