Skip to content

Commit

Permalink
fix: disable summary when it is not available
Browse files Browse the repository at this point in the history
  • Loading branch information
philipparndt committed Jun 24, 2022
1 parent be2de7b commit f036b8f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
10 changes: 10 additions & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -74623,6 +74623,7 @@ const cliParser = __nccwpck_require__(8604)()
const findYarnWorkspaceRoot = __nccwpck_require__(6748)
const debug = __nccwpck_require__(8237)('@cypress/github-action')
const { ping } = __nccwpck_require__(9390)
const { SUMMARY_ENV_VAR } = __nccwpck_require__(1327)

/**
* Parses input command, finds the tool and
Expand Down Expand Up @@ -75359,7 +75360,16 @@ const runTests = async () => {
.then(onTestsFinished, onTestsError)
}

// Summary is not available for GitHub Enterprise at the moment
const isSummaryEnabled = () => {
return process.env[SUMMARY_ENV_VAR] !== undefined
}

const generateSummary = async (testResults) => {
if (!isSummaryEnabled()) {
return testResults
}

const headers = [
{ data: 'Result', header: true },
{ data: 'Passed :white_check_mark:', header: true },
Expand Down
10 changes: 10 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const cliParser = require('argument-vector')()
const findYarnWorkspaceRoot = require('find-yarn-workspace-root')
const debug = require('debug')('@cypress/github-action')
const { ping } = require('./src/ping')
const { SUMMARY_ENV_VAR } = require('@actions/core/lib/summary')

/**
* Parses input command, finds the tool and
Expand Down Expand Up @@ -749,7 +750,16 @@ const runTests = async () => {
.then(onTestsFinished, onTestsError)
}

// Summary is not available for GitHub Enterprise at the moment
const isSummaryEnabled = () => {
return process.env[SUMMARY_ENV_VAR] !== undefined
}

const generateSummary = async (testResults) => {
if (!isSummaryEnabled()) {
return testResults
}

const headers = [
{ data: 'Result', header: true },
{ data: 'Passed :white_check_mark:', header: true },
Expand Down

0 comments on commit f036b8f

Please sign in to comment.