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
4 changes: 4 additions & 0 deletions packages/cli/src/rest/__tests__/test-sessions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ describe('TestSessions REST client', () => {
commitId: 'abc123',
github: {
reporting: true,
source: 'checkly-action',
githubCheckName: 'Checkly PR code checks',
pullRequestNumber: '5',
environmentUrl: 'https://preview.example.com',
repository: 'checkly/playwright-reporter-demo',
sha: 'abc123',
runId: '123456',
Expand Down
12 changes: 12 additions & 0 deletions packages/cli/src/services/__tests__/util.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ const ENV_KEYS = [
'CHECKLY_REPO_URL',
'CHECKLY_REPO_BRANCH',
'CHECKLY_GITHUB_REPORT',
'CHECKLY_GITHUB_SOURCE',
'CHECKLY_GITHUB_CHECK_NAME',
'CHECKLY_GITHUB_PULL_REQUEST_NUMBER',
'CHECKLY_GITHUB_ENVIRONMENT_URL',
'CHECKLY_GITHUB_REPOSITORY',
'CHECKLY_GITHUB_SHA',
'CHECKLY_GITHUB_RUN_ID',
Expand Down Expand Up @@ -95,6 +99,10 @@ describe('util', () => {

it('should include GitHub Actions metadata when Checkly GitHub reporting is enabled', () => {
process.env.CHECKLY_GITHUB_REPORT = 'true'
process.env.CHECKLY_GITHUB_SOURCE = 'checkly-action'
process.env.CHECKLY_GITHUB_CHECK_NAME = 'Checkly PR code checks'
process.env.CHECKLY_GITHUB_PULL_REQUEST_NUMBER = '5'
process.env.CHECKLY_GITHUB_ENVIRONMENT_URL = 'https://preview.example.com'
process.env.CHECKLY_GITHUB_REPOSITORY = 'checkly/playwright-reporter-demo'
process.env.CHECKLY_GITHUB_SHA = 'abc123def456'
process.env.CHECKLY_GITHUB_RUN_ID = '123456'
Expand All @@ -112,6 +120,10 @@ describe('util', () => {
repoUrl: 'https://github.com/checkly/playwright-reporter-demo',
github: {
reporting: true,
source: 'checkly-action',
githubCheckName: 'Checkly PR code checks',
pullRequestNumber: '5',
environmentUrl: 'https://preview.example.com',
repository: 'checkly/playwright-reporter-demo',
sha: 'abc123def456',
runId: '123456',
Expand Down
8 changes: 8 additions & 0 deletions packages/cli/src/services/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ export interface GitInformation {

export interface GitHubActionsInformation {
reporting: true
source?: string
githubCheckName?: string
pullRequestNumber?: string
environmentUrl?: string
repository?: string
sha?: string
runId?: string
Expand Down Expand Up @@ -149,6 +153,10 @@ export function getGitInformation (repoUrl?: string): GitInformation | null {
if (isGitHubReportingEnabled()) {
gitInformation.github = {
reporting: true,
source: process.env.CHECKLY_GITHUB_SOURCE,
githubCheckName: process.env.CHECKLY_GITHUB_CHECK_NAME,
pullRequestNumber: process.env.CHECKLY_GITHUB_PULL_REQUEST_NUMBER,
environmentUrl: process.env.CHECKLY_GITHUB_ENVIRONMENT_URL,
repository: process.env.CHECKLY_GITHUB_REPOSITORY,
sha: process.env.CHECKLY_GITHUB_SHA,
runId: process.env.CHECKLY_GITHUB_RUN_ID,
Expand Down
Loading