Skip to content

Commit 26fdf8f

Browse files
authored
[eas-build-job] Add app_store_connect event context to WorkflowInterpolationContext (#3530)
* [eas-build-job] Add app_store_connect event context to WorkflowInterpolationContext * app_store_connect.app, not app_store_connect.event.app
1 parent 9328063 commit 26fdf8f

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

packages/eas-build-job/src/__tests__/common.test.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,34 @@ describe('StaticWorkflowInterpolationContextZ', () => {
2424
expect(StaticWorkflowInterpolationContextZ.parse(context)).toEqual(context);
2525
});
2626

27+
it('accepts app_store_connect context', () => {
28+
const context = {
29+
after: {},
30+
needs: {},
31+
workflow: {
32+
id: 'workflow-id',
33+
name: 'workflow-name',
34+
filename: 'workflow.yml',
35+
url: 'https://expo.dev/accounts/example/workflows/workflow-id',
36+
},
37+
app: {
38+
id: 'app-id',
39+
slug: 'app-slug',
40+
},
41+
account: {
42+
id: 'account-id',
43+
name: 'account-name',
44+
},
45+
app_store_connect: {
46+
app: {
47+
id: '1234567890',
48+
},
49+
},
50+
};
51+
52+
expect(StaticWorkflowInterpolationContextZ.parse(context)).toEqual(context);
53+
});
54+
2755
it('rejects invalid app and account context', () => {
2856
const context = {
2957
after: {},

packages/eas-build-job/src/common.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,13 @@ export const StaticWorkflowInterpolationContextZ = z.object({
259259
id: z.string(),
260260
name: z.string(),
261261
}),
262+
app_store_connect: z
263+
.looseObject({
264+
app: z.looseObject({
265+
id: z.string(),
266+
}),
267+
})
268+
.optional(),
262269
});
263270

264271
export type StaticWorkflowInterpolationContext = z.infer<

0 commit comments

Comments
 (0)