Skip to content

An open source design system that's fully customizable and agent ready

TypeScript

ci: skip all Storybook work for spec-only PRs (#6102)

Cindy Zhangbfee43a14c82
diff --git a/.github/scripts/spec-owner-workflow.test.mjs b/.github/scripts/spec-owner-workflow.test.mjs
index fe5ac6e139..6d442fe84b 100644
--- a/.github/scripts/spec-owner-workflow.test.mjs
+++ b/.github/scripts/spec-owner-workflow.test.mjs
@@ -132,6 +132,22 @@ describe('spec-only workflow contract', () => {
);
});
+ it('skips every Storybook build command for spec-only changes', () => {
+ const ci = read('.github/workflows/ci.yml');
+ const jobStart = ci.indexOf(' build-storybook:');
+ const jobEnd = ci.indexOf('\n build-sandbox:', jobStart);
+ const buildJob = ci.slice(jobStart, jobEnd);
+ const steps = buildJob.split(/\n - name: /).slice(1);
+ const commandSteps = steps.filter(step =>
+ /\n run: (?:pnpm|node)/.test(step),
+ );
+
+ expect(commandSteps.length).toBeGreaterThan(0);
+ for (const step of commandSteps) {
+ expect(step).toContain("needs.check-scope.outputs.spec_only != 'true'");
+ }
+ });
+
it('fails closed when file APIs are truncated or scope classification fails', () => {
const ci = read('.github/workflows/ci.yml');
expect(ci).toContain('if: ${{ always() && !cancelled() }}');
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 5d50cb9589..b341a057e2 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -349,11 +349,11 @@ jobs:
run: pnpm -F @astryxdesign/charts typecheck:docs
- name: Typecheck rich text docs
- if: needs.check-scope.outputs.docsite_only != 'true'
+ if: needs.check-scope.outputs.docsite_only != 'true' && needs.check-scope.outputs.spec_only != 'true'
run: pnpm -F @astryxdesign/richtext typecheck:docs
- name: Typecheck Vega docs
- if: needs.check-scope.outputs.docsite_only != 'true'
+ if: needs.check-scope.outputs.docsite_only != 'true' && needs.check-scope.outputs.spec_only != 'true'
run: pnpm -F @astryxdesign/vega typecheck:docs
- name: Typecheck template docs