Merge pull request #24 from actions/decouple-telemetry

Decouple telemetry API call from main action
This commit is contained in:
Jess Bees
2022-03-31 12:34:24 -04:00
committed by GitHub
4 changed files with 22 additions and 4 deletions

View File

@@ -3,8 +3,10 @@ description: 'A GitHub Action to deploy an artifact to GitHub Pages'
runs:
using: 'node16'
main: 'dist/index.js'
pre: 'pre/index.js'
inputs:
emit_telemetry:
description: 'Should this action only emit build telemetry instead of deploying the build artifact?'
required: false
token:
description: 'GitHub token'
default: ${{ github.token }}

10
dist/index.js vendored
View File

@@ -7473,7 +7473,15 @@ process.on('SIGINT', cancelHandler)
process.on('SIGTERM', cancelHandler)
// Main
main().then(() => __nccwpck_require__(9557))
const emitTelemetry = core.getInput("emit_telemetry")
if (emitTelemetry === "true") {
__nccwpck_require__(9557)
} else if (emitTelemetry === "false") {
main()
} else {
// If emit_telemetry is not set, that indicates an older version of the dynamic workflow that doesn't separate telemetry from deployment
main().then(() => __nccwpck_require__(9557))
}
})();

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@@ -52,4 +52,12 @@ process.on('SIGINT', cancelHandler)
process.on('SIGTERM', cancelHandler)
// Main
main().then(() => require('./pre'))
const emitTelemetry = core.getInput("emit_telemetry")
if (emitTelemetry === "true") {
require('./pre')
} else if (emitTelemetry === "false") {
main()
} else {
// If emit_telemetry is not set, that indicates an older version of the dynamic workflow that doesn't separate telemetry from deployment
main().then(() => require('./pre'))
}