mirror of
https://github.com/actions/deploy-pages.git
synced 2025-12-08 08:06:15 +00:00
Merge pull request #62 from actions/pages/get-build-conclusion
Add optional 'conclusion' argument to emitTelemetry
This commit is contained in:
@@ -9,6 +9,9 @@ inputs:
|
|||||||
description: 'Should this action only emit build telemetry instead of deploying the build artifact?'
|
description: 'Should this action only emit build telemetry instead of deploying the build artifact?'
|
||||||
required: false
|
required: false
|
||||||
default: 'false'
|
default: 'false'
|
||||||
|
conclusion:
|
||||||
|
description: 'The status of the previous build.'
|
||||||
|
required: false
|
||||||
token:
|
token:
|
||||||
description: 'GitHub token'
|
description: 'GitHub token'
|
||||||
default: ${{ github.token }}
|
default: ${{ github.token }}
|
||||||
|
|||||||
5
dist/index.js
vendored
5
dist/index.js
vendored
@@ -8463,11 +8463,12 @@ async function emitTelemetry() {
|
|||||||
// All variables we need from the runtime are set in the Deployment constructor
|
// All variables we need from the runtime are set in the Deployment constructor
|
||||||
const deployment = new Deployment()
|
const deployment = new Deployment()
|
||||||
const telemetryUrl = `${deployment.githubApiUrl}/repos/${deployment.repositoryNwo}/pages/telemetry`
|
const telemetryUrl = `${deployment.githubApiUrl}/repos/${deployment.repositoryNwo}/pages/telemetry`
|
||||||
core.info(`Sending telemetry for run id ${deployment.workflowRun}`)
|
const conclusion = core.getInput('conclusion') || null
|
||||||
|
core.info(`Sending telemetry for run id ${deployment.workflowRun}: ${conclusion}`)
|
||||||
await axios
|
await axios
|
||||||
.post(
|
.post(
|
||||||
telemetryUrl,
|
telemetryUrl,
|
||||||
{ github_run_id: deployment.workflowRun },
|
{ github_run_id: deployment.workflowRun, conclusion },
|
||||||
{
|
{
|
||||||
headers: {
|
headers: {
|
||||||
Accept: 'application/vnd.github.v3+json',
|
Accept: 'application/vnd.github.v3+json',
|
||||||
|
|||||||
2
dist/index.js.map
vendored
2
dist/index.js.map
vendored
File diff suppressed because one or more lines are too long
@@ -8463,11 +8463,12 @@ async function emitTelemetry() {
|
|||||||
// All variables we need from the runtime are set in the Deployment constructor
|
// All variables we need from the runtime are set in the Deployment constructor
|
||||||
const deployment = new Deployment()
|
const deployment = new Deployment()
|
||||||
const telemetryUrl = `${deployment.githubApiUrl}/repos/${deployment.repositoryNwo}/pages/telemetry`
|
const telemetryUrl = `${deployment.githubApiUrl}/repos/${deployment.repositoryNwo}/pages/telemetry`
|
||||||
core.info(`Sending telemetry for run id ${deployment.workflowRun}`)
|
const conclusion = core.getInput('conclusion') || null
|
||||||
|
core.info(`Sending telemetry for run id ${deployment.workflowRun}: ${conclusion}`)
|
||||||
await axios
|
await axios
|
||||||
.post(
|
.post(
|
||||||
telemetryUrl,
|
telemetryUrl,
|
||||||
{ github_run_id: deployment.workflowRun },
|
{ github_run_id: deployment.workflowRun, conclusion },
|
||||||
{
|
{
|
||||||
headers: {
|
headers: {
|
||||||
Accept: 'application/vnd.github.v3+json',
|
Accept: 'application/vnd.github.v3+json',
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -22,11 +22,12 @@ async function emitTelemetry() {
|
|||||||
// All variables we need from the runtime are set in the Deployment constructor
|
// All variables we need from the runtime are set in the Deployment constructor
|
||||||
const deployment = new Deployment()
|
const deployment = new Deployment()
|
||||||
const telemetryUrl = `${deployment.githubApiUrl}/repos/${deployment.repositoryNwo}/pages/telemetry`
|
const telemetryUrl = `${deployment.githubApiUrl}/repos/${deployment.repositoryNwo}/pages/telemetry`
|
||||||
core.info(`Sending telemetry for run id ${deployment.workflowRun}`)
|
const conclusion = core.getInput('conclusion') || null
|
||||||
|
core.info(`Sending telemetry for run id ${deployment.workflowRun}: ${conclusion}`)
|
||||||
await axios
|
await axios
|
||||||
.post(
|
.post(
|
||||||
telemetryUrl,
|
telemetryUrl,
|
||||||
{ github_run_id: deployment.workflowRun },
|
{ github_run_id: deployment.workflowRun, conclusion },
|
||||||
{
|
{
|
||||||
headers: {
|
headers: {
|
||||||
Accept: 'application/vnd.github.v3+json',
|
Accept: 'application/vnd.github.v3+json',
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ describe('emitTelemetry', () => {
|
|||||||
process.env.GITHUB_ACTOR = 'monalisa'
|
process.env.GITHUB_ACTOR = 'monalisa'
|
||||||
process.env.GITHUB_ACTION = '__monalisa/octocat'
|
process.env.GITHUB_ACTION = '__monalisa/octocat'
|
||||||
process.env.GITHUB_ACTION_PATH = 'something'
|
process.env.GITHUB_ACTION_PATH = 'something'
|
||||||
|
process.env.INPUT_CONCLUSION = 'success'
|
||||||
|
|
||||||
jest.spyOn(core, 'setOutput').mockImplementation(param => {
|
jest.spyOn(core, 'setOutput').mockImplementation(param => {
|
||||||
return param
|
return param
|
||||||
@@ -47,7 +48,8 @@ describe('emitTelemetry', () => {
|
|||||||
expect(axios.post).toBeCalledWith(
|
expect(axios.post).toBeCalledWith(
|
||||||
'https://api.github.com/repos/actions/is-awesome/pages/telemetry',
|
'https://api.github.com/repos/actions/is-awesome/pages/telemetry',
|
||||||
{
|
{
|
||||||
github_run_id: process.env.GITHUB_RUN_ID
|
github_run_id: process.env.GITHUB_RUN_ID,
|
||||||
|
conclusion: 'success'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
headers: {
|
headers: {
|
||||||
|
|||||||
Reference in New Issue
Block a user