Skip to content

Commit 51579ef

Browse files
- fix branch name in test details
1 parent e84ed1a commit 51579ef

File tree

5 files changed

+26
-13
lines changed

5 files changed

+26
-13
lines changed

dist/index.js

+10-4
Original file line numberDiff line numberDiff line change
@@ -58683,6 +58683,8 @@ async function GetProjectDetails() {
5868358683
let infoPlistContent = plist.parse(fs.readFileSync(infoPlistPath, 'utf8'));
5868458684
const versionString = infoPlistContent['CFBundleShortVersionString'];
5868558685
core.info(`Version string: ${versionString}`);
58686+
const buildString = infoPlistContent['CFBundleVersion'];
58687+
core.info(`Build string: ${buildString}`);
5868658688
return new XcodeProject_1.XcodeProject(projectPath, projectName, platform, bundleId, projectDirectory, versionString, scheme);
5868758689
}
5868858690
async function parseBuildSettings(projectPath, scheme) {
@@ -59286,19 +59288,23 @@ async function getWhatsNew() {
5928659288
const branchNameDetails = await execGit(['log', head, '-1', '--format=%d']);
5928759289
const branchNameMatch = branchNameDetails.match(/\((?<branch>.+)\)/);
5928859290
let branchName = '';
59289-
if (branchNameMatch) {
59291+
if (branchNameMatch && branchNameMatch.groups) {
59292+
branchName = branchNameMatch.groups.branch;
5929059293
if (branchName.includes(' -> ')) {
5929159294
branchName = branchName.split(' -> ')[1];
5929259295
}
5929359296
if (branchName.includes(',')) {
5929459297
branchName = branchName.split(',')[1];
5929559298
}
59296-
if (branchName.includes('origin/')) {
59297-
branchName = branchName.split('origin/')[1];
59299+
if (branchName.includes('/')) {
59300+
branchName = branchName.split('/')[1];
5929859301
}
5929959302
}
59300-
const commitMessage = await execGit(['log', head, '-1', '--format=%s']);
59303+
const commitMessage = await execGit(['log', head, '-1', '--format=%B']);
5930159304
whatsNew = `[${commitSha.trim()}]${branchName.trim()}\n${commitMessage.trim()}`;
59305+
if (whatsNew.length > 4000) {
59306+
whatsNew = `${whatsNew.substring(0, 3997)}...`;
59307+
}
5930259308
}
5930359309
if (whatsNew.length === 0) {
5930459310
throw new Error('Test details empty!');

dist/index.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "unity-xcode-builder",
3-
"version": "1.1.0",
3+
"version": "1.1.1",
44
"description": "A GitHub Action to build, archive, and upload Unity exported xcode projects.",
55
"author": "RageAgainstThePixel",
66
"license": "MIT",

src/xcode.ts

+12-5
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ async function GetProjectDetails(): Promise<XcodeProject> {
5959
let infoPlistContent = plist.parse(fs.readFileSync(infoPlistPath, 'utf8'));
6060
const versionString = infoPlistContent['CFBundleShortVersionString'];
6161
core.info(`Version string: ${versionString}`);
62+
const buildString = infoPlistContent['CFBundleVersion'];
63+
core.info(`Build string: ${buildString}`);
6264
return new XcodeProject(
6365
projectPath,
6466
projectName,
@@ -93,7 +95,8 @@ async function parseBuildSettings(projectPath: string, scheme: string): Promise<
9395
if (!platformName) {
9496
throw new Error('Unable to determine the platform name from the build settings');
9597
}
96-
const bundleId = core.getInput('bundle-id') || matchRegexPattern(buildSettingsOutput, /\s+PRODUCT_BUNDLE_IDENTIFIER = (?<bundleId>[\w.-]+)/, 'bundleId'); if (!bundleId || bundleId === 'NO') {
98+
const bundleId = core.getInput('bundle-id') || matchRegexPattern(buildSettingsOutput, /\s+PRODUCT_BUNDLE_IDENTIFIER = (?<bundleId>[\w.-]+)/, 'bundleId');
99+
if (!bundleId || bundleId === 'NO') {
97100
throw new Error('Unable to determine the bundle ID from the build settings');
98101
}
99102
const platforms = {
@@ -670,19 +673,23 @@ async function getWhatsNew(): Promise<string> {
670673
const branchNameDetails = await execGit(['log', head, '-1', '--format=%d']);
671674
const branchNameMatch = branchNameDetails.match(/\((?<branch>.+)\)/);
672675
let branchName = '';
673-
if (branchNameMatch) {
676+
if (branchNameMatch && branchNameMatch.groups) {
677+
branchName = branchNameMatch.groups.branch;
674678
if (branchName.includes(' -> ')) {
675679
branchName = branchName.split(' -> ')[1];
676680
}
677681
if (branchName.includes(',')) {
678682
branchName = branchName.split(',')[1];
679683
}
680-
if (branchName.includes('origin/')) {
681-
branchName = branchName.split('origin/')[1];
684+
if (branchName.includes('/')) {
685+
branchName = branchName.split('/')[1];
682686
}
683687
}
684-
const commitMessage = await execGit(['log', head, '-1', '--format=%s']);
688+
const commitMessage = await execGit(['log', head, '-1', '--format=%B']);
685689
whatsNew = `[${commitSha.trim()}]${branchName.trim()}\n${commitMessage.trim()}`;
690+
if (whatsNew.length > 4000) {
691+
whatsNew = `${whatsNew.substring(0, 3997)}...`;
692+
}
686693
}
687694
if (whatsNew.length === 0) {
688695
throw new Error('Test details empty!');

0 commit comments

Comments
 (0)