Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions node-src/tasks/build.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,9 @@ describe('buildStorybook', () => {
await buildStorybook(ctx);
expect(command).toHaveBeenCalledWith(
ctx.buildCommand,
expect.objectContaining({ env: { CI: '1', NODE_ENV: 'production' } })
expect.objectContaining({
env: { CI: '1', NODE_ENV: 'production', STORYBOOK_INVOKED_BY: 'chromatic' },
})
);
});

Expand All @@ -204,7 +206,9 @@ describe('buildStorybook', () => {
await buildStorybook(ctx);
expect(command).toHaveBeenCalledWith(
ctx.buildCommand,
expect.objectContaining({ env: { CI: '1', NODE_ENV: 'test' } })
expect.objectContaining({
env: { CI: '1', NODE_ENV: 'test', STORYBOOK_INVOKED_BY: 'chromatic' },
})
);
});
});
Expand Down
6 changes: 5 additions & 1 deletion node-src/tasks/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,11 @@ export const buildStorybook = async (ctx: Context) => {
// action (node20), not the version set in the workflow
preferLocal: false,
signal,
env: { CI: '1', NODE_ENV: ctx.env.STORYBOOK_NODE_ENV || 'production' },
env: {
CI: '1',
NODE_ENV: ctx.env.STORYBOOK_NODE_ENV || 'production',
STORYBOOK_INVOKED_BY: 'chromatic',
},
});
await Promise.race([subprocess, timeoutAfter(ctx.env.STORYBOOK_BUILD_TIMEOUT)]);
} catch (err) {
Expand Down
Loading