{"name":"@percy/env","version":"1.30.0","license":"MIT","_id":"@percy/env@1.30.0","homepage":"https://github.com/percy/cli#readme","bugs":{"url":"https://github.com/percy/cli/issues"},"dist":{"shasum":"e3f226c9b2d372523a22c2316d08f3d066061327","tarball":"http://registry-npm.ywwl.com/@percy/env/download/@percy/env-1.30.0.tgz","fileCount":8,"integrity":"sha512-+h7c0lxB01bnymTZfM24RrjMIL28rQWeT4aQ/BJVlvAELstZaYwl0vv8RrAtBUKnSZaXUkNIOWZtgFiuer/y0g==","signatures":[{"sig":"MEUCIQC6ECCu4XnRrOWJmy7Pc74b4REC7fOkLEOjPIeR3wlZkwIgcGdI/NXXfAuqfDS90YSYOWRh2hcuXrTlDJehnXTOUWo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":20411,"size":6549,"noattachment":false,"key":"/@percy/env/-/@percy/env-1.30.0.tgz"},"main":"./dist/index.js","type":"module","engines":{"node":">=14"},"exports":{".":"./dist/index.js","./utils":"./dist/utils.js","./test/helpers":"./test/helpers.js"},"gitHead":"0f9c627b5100eaf4d7262c6671764ffb38d23d33","scripts":{"lint":"eslint --ignore-path ../../.gitignore .","test":"node ../../scripts/test","build":"node ../../scripts/build","test:coverage":"yarn test --coverage"},"_npmUser":{"name":"percy-admin","email":"apps+npm@percy.io"},"repository":{"url":"git+https://github.com/percy/cli.git","type":"git","directory":"packages/env"},"_npmVersion":"lerna/6.0.1/node@v14.21.3+x64 (linux)","description":"This package provides various CI/CD support for Percy by coalescing different environment variables into a common interface for consumption by `@percy/client`.","directories":{},"_nodeVersion":"14.21.3","dependencies":{"@percy/logger":"1.30.0"},"publishConfig":{"tag":"latest","access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/env_1.30.0_1728282910432_0.4650482024761886","host":"s3://npm-registry-packages"},"readme":"# @percy/env\n\nThis package provides various CI/CD support for Percy by coalescing different environment variables\ninto a common interface for consumption by `@percy/client`.\n\n## Supported Environments\n\nAuto-detected based on environment variables that the CI provider sets during a build.\n\n- [AppVeyor](https://www.browserstack.com/docs/percy/ci-cd/appveyor)\n- [Atlassian Bamboo](#supported-environments) (needs doc)\n- [AWS CodeBuild](#supported-environments) (needs doc)\n- [Azure Pipelines](https://www.browserstack.com/docs/percy/ci-cd/azure-pipelines)\n- [Bitbucket Pipelines](https://www.browserstack.com/docs/percy/ci-cd/bitbucket-pipeline)\n- [Bitrise](#supported-environments) (needs doc)\n- [Buildkite](https://www.browserstack.com/docs/percy/ci-cd/buildkite)\n- [CircleCI](https://www.browserstack.com/docs/percy/ci-cd/circleci)\n- [Cloudflare Pages](#supported-environments) (needs doc)\n- [Codemagic](#supported-environments) (needs doc)\n- [Codeship](https://www.browserstack.com/docs/percy/ci-cd/codeship)\n- [Drone CI](https://docs.percy.io/docs/drone)\n- [GitHub Actions](https://www.browserstack.com/docs/percy/ci-cd/github-actions)\n- [GitLab CI](https://www.browserstack.com/docs/percy/ci-cd/gitlab)\n- [GoCD](#supported-environments) (needs doc)\n- [Google Cloud Build](#supported-environments) (needs doc)\n- [Harness CI](#supported-environments) (needs doc)\n- [Heroku CI](#supported-environments) (needs doc)\n- [Jenkins](https://www.browserstack.com/docs/percy/ci-cd/jenkins)\n- [Jenkins PRB](https://www.browserstack.com/docs/percy/ci-cd/jenkins)\n- [Netlify](https://www.browserstack.com/docs/percy/ci-cd/netlify)\n- [Probo.CI](#supported-environments) (needs doc)\n- [Semaphore](https://www.browserstack.com/docs/percy/ci-cd/semaphore)\n- [TeamCity](#supported-environments) (needs doc)\n- [Travis CI](https://www.browserstack.com/docs/percy/ci-cd/travis-ci)\n- [Vercel](#vercel) — see note below\n- [Woodpecker CI](#supported-environments) (needs doc)\n\n## Opt-in Environments\n\nKubernetes-native pipelines do not inject provider-identifying environment variables\ninto step containers by default. To enable Percy detection on these systems, expose\nthe following variables via template substitution in your pipeline definition.\n\n### Tekton Pipelines\n\n```yaml\nsteps:\n  - name: percy\n    image: node:20\n    env:\n      - name: TEKTON_PIPELINE_RUN          # required — triggers detection\n        value: \"$(context.pipelineRun.name)\"\n      - name: TEKTON_COMMIT_SHA\n        value: \"$(params.commit-sha)\"\n      - name: TEKTON_BRANCH\n        value: \"$(params.branch)\"\n      - name: TEKTON_PULL_REQUEST          # optional\n        value: \"$(params.pr-number)\"\n```\n\n### Argo Workflows\n\n```yaml\n- name: percy\n  container:\n    image: node:20\n    env:\n      - name: ARGO_WORKFLOW_NAME           # required — triggers detection\n        value: \"{{workflow.name}}\"\n      - name: ARGO_WORKFLOW_UID            # recommended — used as parallel nonce\n        value: \"{{workflow.uid}}\"\n      - name: ARGO_COMMIT_SHA\n        value: \"{{workflow.parameters.commit-sha}}\"\n      - name: ARGO_BRANCH\n        value: \"{{workflow.parameters.branch}}\"\n      - name: ARGO_PULL_REQUEST            # optional\n        value: \"{{workflow.parameters.pr-number}}\"\n```\n\n### Vercel\n\nVercel exposes its `VERCEL_*` system environment variables to the build step only\nwhen **Automatically expose System Environment Variables** is enabled on the project\n(Settings → Environment Variables). Percy also needs `PERCY_PARALLEL_TOTAL=-1`\nset in the project environment for the parallel nonce to populate from\n`VERCEL_DEPLOYMENT_ID` — otherwise reruns of the same deploy will create separate\nPercy builds instead of deduping.\n\n## Percy Environment Variables\n\nThe following variables may be defined to override the respective derived CI environment variables.\n\n```bash\nPERCY_COMMIT          # build commit sha\nPERCY_BRANCH          # build branch name\nPERCY_PULL_REQUEST    # associated PR number\nPERCY_PARALLEL_NONCE  # parallel nonce unique for this CI workflow\nPERCY_PARALLEL_TOTAL  # total number of parallel shards\n```\n\nAdditional Percy specific environment variable may be set to control aspects of your Percy build.\n\n```bash\nPERCY_TARGET_COMMIT   # percy target commit sha\nPERCY_TARGET_BRANCH   # percy target branch name\nPERCY_PARTIAL_BUILD   # if this build was marked as partial\n```\n\n## Adding Environment Support\n\n1. Add CI detection to [`environment.js`](./src/environment.js)\n2. Add respective environment variables\n3. Add a dedicated CI test suite\n4. Open a Pull Request!\n","publish_time":1728282910635,"maintainers":[{"name":"percy-admin","email":"apps+npm@percy.io"}],"_cnpm_publish_time":1728282910635,"dist-tags":{"alpha":"1.31.15-alpha.0","beta":"1.33.0-beta.0","latest":"1.33.1"}}