HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers10/shop.komma.nl/node_modules/env-ci/services/semaphore.js
const {head} = require('../lib/git');

// https://semaphoreci.com/docs/available-environment-variables.html

module.exports = {
	detect({env}) {
		return Boolean(env.SEMAPHORE);
	},
	configuration({env, cwd}) {
		const pr = env.PULL_REQUEST_NUMBER;
		const isPr = Boolean(pr);

		return {
			name: 'Semaphore',
			service: 'semaphore',
			commit: head({env, cwd}),
			build: env.SEMAPHORE_BUILD_NUMBER,
			branch: isPr ? undefined : env.BRANCH_NAME,
			pr,
			isPr,
			prBranch: isPr ? env.BRANCH_NAME : undefined,
			slug: env.SEMAPHORE_REPO_SLUG,
			root: env.SEMAPHORE_PROJECT_DIR,
		};
	},
};