Skip to content

CI and source links

The reporter can add source links to each scenario (e.g. “Source: file”) and, in GitHub Actions, append the report to the job summary.

If you set permalinkBaseUrl in the reporter config, each scenario in the report gets a source link:

## ✅ User logs in
Source: [login.story.test.ts](https://github.com/org/repo/blob/abc123/src/auth/login.story.test.ts)
- **Given** user is on login page
...

In CI, set permalinkBaseUrl from environment variables, for example:

// Example: Jest
reporters: ["default", ["executable-stories-jest/reporter", {
output: "docs/user-stories.md",
permalinkBaseUrl: process.env.GITHUB_SERVER_URL + '/' + process.env.GITHUB_REPOSITORY + '/blob/' + process.env.GITHUB_SHA + '/',
}]],

Same idea for Vitest and Playwright: pass the base URL (including trailing slash) so the reporter can build permalinkBaseUrl + relativePath for each file.

If permalinkBaseUrl is not set and GITHUB_ACTIONS is set, the reporter builds the base URL from:

  • GITHUB_SERVER_URL
  • GITHUB_REPOSITORY
  • GITHUB_SHA
  • and the project root

So source links can work in GitHub Actions without any config. To disable source links, set includeSourceLinks: false in the reporter options.

Report Output what this code generates
Report showing ticket badges and source file links
Ticket badges link to your issue tracker; source links go to the exact file on GitHub

When enableGithubActionsSummary is true (default) and process.env.GITHUB_ACTIONS === 'true', the reporter appends the Markdown report to the GitHub Actions job summary. The report then appears on the workflow run page.

  • If @actions/core is available (installed in the repo), the reporter uses it to append to the job summary.
  • If @actions/core is not available, the reporter skips the summary and still writes the Markdown file(s).

To disable the job summary: set enableGithubActionsSummary: false in the reporter config.

Jest:

[
'executable-stories-jest/reporter',
{ output: 'docs/user-stories.md', enableGithubActionsSummary: false },
];

Vitest: new StoryReporter({ enableGithubActionsSummary: false }).

Playwright: ["executable-stories-playwright/reporter", { output: "docs/user-stories.md", enableGithubActionsSummary: false }].