MCPcopy
hub / github.com/ampproject/amphtml / setPercyBranch

Function setPercyBranch

build-system/tasks/visual-diff/index.js:119–125  ·  view source on GitHub ↗

* Disambiguates branch names by decorating them with the commit author name. * We do this for all non-push builds in order to prevent them from being used * as baselines for future builds.

()

Source from the content-addressed store, hash-verified

117 * as baselines for future builds.
118 */
119function setPercyBranch() {
120 if (!process.env['PERCY_BRANCH'] && (!argv.main || !isCiBuild())) {
121 const userName = gitCommitterEmail();
122 const branchName = gitBranchName();
123 process.env['PERCY_BRANCH'] = userName + '-' + branchName;
124 }
125}
126
127/**
128 * Set the branching point's SHA to an env variable.

Callers 1

visualDiffFunction · 0.85

Calls 3

isCiBuildFunction · 0.85
gitCommitterEmailFunction · 0.85
gitBranchNameFunction · 0.85

Tested by

no test coverage detected