Skip to content

Commit 2bd0367

Browse files
unity-xcode-builder@v1.3.1 (#19)
- fix autoNotifyUsers undefined attribute
1 parent a84a60e commit 2bd0367

File tree

5 files changed

+45
-47
lines changed

5 files changed

+45
-47
lines changed

dist/index.js

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -57931,35 +57931,34 @@ async function autoNotifyBetaUsers(project, build) {
5793157931
await getOrCreateClient(project);
5793257932
let buildBetaDetail = null;
5793357933
if (!((_a = build.relationships) === null || _a === void 0 ? void 0 : _a.buildBetaDetail)) {
57934-
buildBetaDetail = await getBetaAppBuildSubmissionDetails(project, build);
57934+
buildBetaDetail = await getBetaAppBuildSubmissionDetails(build);
5793557935
}
5793657936
else {
5793757937
buildBetaDetail = build.relationships.buildBetaDetail.data;
5793857938
}
5793957939
if (!((_b = buildBetaDetail.attributes) === null || _b === void 0 ? void 0 : _b.autoNotifyEnabled)) {
57940-
buildBetaDetail.attributes.autoNotifyEnabled = true;
57941-
}
57942-
const payload = {
57943-
path: { id: buildBetaDetail.id },
57944-
body: {
57945-
data: {
57946-
id: buildBetaDetail.id,
57947-
type: 'buildBetaDetails',
57948-
attributes: {
57949-
autoNotifyEnabled: buildBetaDetail.attributes.autoNotifyEnabled
57940+
const payload = {
57941+
path: { id: buildBetaDetail.id },
57942+
body: {
57943+
data: {
57944+
id: buildBetaDetail.id,
57945+
type: 'buildBetaDetails',
57946+
attributes: {
57947+
autoNotifyEnabled: true
57948+
}
5795057949
}
5795157950
}
57951+
};
57952+
const { data: response, error } = await appStoreConnectClient.api.BuildBetaDetailsService.buildBetaDetailsUpdateInstance(payload);
57953+
if (error) {
57954+
checkAuthError(error);
57955+
throw new Error(`Error updating beta build details: ${JSON.stringify(error, null, 2)}`);
5795257956
}
57953-
};
57954-
const { data: response, error } = await appStoreConnectClient.api.BuildBetaDetailsService.buildBetaDetailsUpdateInstance(payload);
57955-
if (error) {
57956-
checkAuthError(error);
57957-
throw new Error(`Error updating beta build details: ${JSON.stringify(error, null, 2)}`);
57957+
const responseJson = JSON.stringify(response, null, 2);
57958+
(0, utilities_1.log)(responseJson);
5795857959
}
57959-
const responseJson = JSON.stringify(response, null, 2);
57960-
(0, utilities_1.log)(responseJson);
5796157960
}
57962-
async function getBetaAppBuildSubmissionDetails(project, build) {
57961+
async function getBetaAppBuildSubmissionDetails(build) {
5796357962
const payload = {
5796457963
query: {
5796557964
"filter[build]": [build.id],

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "unity-xcode-builder",
3-
"version": "1.3.0",
3+
"version": "1.3.1",
44
"description": "A GitHub Action to build, archive, and upload Unity exported xcode projects.",
55
"author": "buildalon",
66
"license": "MIT",
@@ -25,7 +25,7 @@
2525
"uuid": "^10.0.0"
2626
},
2727
"devDependencies": {
28-
"@types/node": "^22.15.18",
28+
"@types/node": "^22.15.21",
2929
"@types/plist": "^3.0.5",
3030
"@types/semver": "^7.7.0",
3131
"@types/uuid": "^10.0.0",

src/AppStoreConnectClient.ts

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -352,35 +352,34 @@ async function autoNotifyBetaUsers(project: XcodeProject, build: Build): Promise
352352
await getOrCreateClient(project);
353353
let buildBetaDetail: BuildBetaDetail = null;
354354
if (!build.relationships?.buildBetaDetail) {
355-
buildBetaDetail = await getBetaAppBuildSubmissionDetails(project, build);
355+
buildBetaDetail = await getBetaAppBuildSubmissionDetails(build);
356356
} else {
357357
buildBetaDetail = build.relationships.buildBetaDetail.data;
358358
}
359359
if (!buildBetaDetail.attributes?.autoNotifyEnabled) {
360-
buildBetaDetail.attributes.autoNotifyEnabled = true;
361-
}
362-
const payload: BuildBetaDetailsUpdateInstanceData = {
363-
path: { id: buildBetaDetail.id },
364-
body: {
365-
data: {
366-
id: buildBetaDetail.id,
367-
type: 'buildBetaDetails',
368-
attributes: {
369-
autoNotifyEnabled: buildBetaDetail.attributes.autoNotifyEnabled
360+
const payload: BuildBetaDetailsUpdateInstanceData = {
361+
path: { id: buildBetaDetail.id },
362+
body: {
363+
data: {
364+
id: buildBetaDetail.id,
365+
type: 'buildBetaDetails',
366+
attributes: {
367+
autoNotifyEnabled: true
368+
}
370369
}
371370
}
371+
};
372+
const { data: response, error } = await appStoreConnectClient.api.BuildBetaDetailsService.buildBetaDetailsUpdateInstance(payload);
373+
if (error) {
374+
checkAuthError(error);
375+
throw new Error(`Error updating beta build details: ${JSON.stringify(error, null, 2)}`);
372376
}
373-
};
374-
const { data: response, error } = await appStoreConnectClient.api.BuildBetaDetailsService.buildBetaDetailsUpdateInstance(payload);
375-
if (error) {
376-
checkAuthError(error);
377-
throw new Error(`Error updating beta build details: ${JSON.stringify(error, null, 2)}`);
377+
const responseJson = JSON.stringify(response, null, 2);
378+
log(responseJson);
378379
}
379-
const responseJson = JSON.stringify(response, null, 2);
380-
log(responseJson);
381380
}
382381

383-
async function getBetaAppBuildSubmissionDetails(project: XcodeProject, build: Build): Promise<BuildBetaDetail> {
382+
async function getBetaAppBuildSubmissionDetails(build: Build): Promise<BuildBetaDetail> {
384383
const payload: BuildBetaDetailsGetCollectionData = {
385384
query: {
386385
"filter[build]": [build.id],

0 commit comments

Comments
 (0)