Skip to content

Commit f036b8f

Browse files
committed
fix: disable summary when it is not available
1 parent be2de7b commit f036b8f

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

dist/index.js

+10
Original file line numberDiff line numberDiff line change
@@ -74623,6 +74623,7 @@ const cliParser = __nccwpck_require__(8604)()
7462374623
const findYarnWorkspaceRoot = __nccwpck_require__(6748)
7462474624
const debug = __nccwpck_require__(8237)('@cypress/github-action')
7462574625
const { ping } = __nccwpck_require__(9390)
74626+
const { SUMMARY_ENV_VAR } = __nccwpck_require__(1327)
7462674627

7462774628
/**
7462874629
* Parses input command, finds the tool and
@@ -75359,7 +75360,16 @@ const runTests = async () => {
7535975360
.then(onTestsFinished, onTestsError)
7536075361
}
7536175362

75363+
// Summary is not available for GitHub Enterprise at the moment
75364+
const isSummaryEnabled = () => {
75365+
return process.env[SUMMARY_ENV_VAR] !== undefined
75366+
}
75367+
7536275368
const generateSummary = async (testResults) => {
75369+
if (!isSummaryEnabled()) {
75370+
return testResults
75371+
}
75372+
7536375373
const headers = [
7536475374
{ data: 'Result', header: true },
7536575375
{ data: 'Passed :white_check_mark:', header: true },

index.js

+10
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ const cliParser = require('argument-vector')()
1313
const findYarnWorkspaceRoot = require('find-yarn-workspace-root')
1414
const debug = require('debug')('@cypress/github-action')
1515
const { ping } = require('./src/ping')
16+
const { SUMMARY_ENV_VAR } = require('@actions/core/lib/summary')
1617

1718
/**
1819
* Parses input command, finds the tool and
@@ -749,7 +750,16 @@ const runTests = async () => {
749750
.then(onTestsFinished, onTestsError)
750751
}
751752

753+
// Summary is not available for GitHub Enterprise at the moment
754+
const isSummaryEnabled = () => {
755+
return process.env[SUMMARY_ENV_VAR] !== undefined
756+
}
757+
752758
const generateSummary = async (testResults) => {
759+
if (!isSummaryEnabled()) {
760+
return testResults
761+
}
762+
753763
const headers = [
754764
{ data: 'Result', header: true },
755765
{ data: 'Passed :white_check_mark:', header: true },

0 commit comments

Comments
 (0)