Skip to main content

getGitInformation

@webda/core


Function: getGitInformation()

getGitInformation(cwd, packageName?, version?): GitInformation

Defined in: packages/core/src/deployers/git.ts:40

Retrieve the git information of a repository

The GIT_INFO environment variable (base64 JSON of GitInformation) takes precedence, useful when building without the repository (containers). The version is the package version when the current commit has the tag <packageName>@<version> or v<version>, otherwise a snapshot version from nextSnapshotVersion.

Parameters​

cwd​

string

a folder within the repository

packageName?​

string = ""

the package name, to find the version tag

version?​

string = ""

the package version

Returns​

GitInformation

the git information, with unknown commit and branch outside of a repository