Fix formatting

This commit is contained in:
Boris Proshin 2024-10-05 14:59:19 +03:00
parent b80318f233
commit bd58cbedf7
3 changed files with 5 additions and 3 deletions

BIN
dist/index.js generated vendored

Binary file not shown.

BIN
dist/index.js.map generated vendored

Binary file not shown.

View File

@ -209,16 +209,18 @@ export default class Versioning {
static async getVersionDescription() {
const versionTags = (await this.git(['tag', '--list', '--merged', 'HEAD', '--sort=-creatordate']))
.split('\n')
.filter(tag => new RegExp(this.grepCompatibleInputVersionRegex).test(tag));
.filter((tag) => new RegExp(this.grepCompatibleInputVersionRegex).test(tag));
if (versionTags.length === 0) {
core.warning('No valid version tags found. Using fallback description.');
return this.git(['describe', '--long', '--tags', '--always', 'HEAD']);
}
const latestVersionTag = versionTags[0];
const commitsCount = (await this.git(['rev-list', `${latestVersionTag}..HEAD`, '--count'])).trim();
const commitHash = (await this.git(['rev-parse', '--short', 'HEAD'])).trim();
return `${latestVersionTag}-${commitsCount}-g${commitHash}`;
}