Skip to content

Commit

Permalink
Add additional fields to pages deploy detailed artifact
Browse files Browse the repository at this point in the history
  • Loading branch information
Maximo-Guk committed Nov 13, 2024
1 parent c12c0fe commit 1ece459
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
17 changes: 17 additions & 0 deletions packages/wrangler/src/output.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,23 @@ interface OutputEntryPagesDeploymentDetailed
alias: string | undefined;
/** The environment being deployed to */
environment: "production" | "preview";
/** The name of the pages project */
project_name: string;
/** The production branch of the pages project */
production_branch: string;
/** Stages of the pages project */
stages: {
name: "queued" | "initialize" | "clone_repo" | "build" | "deploy";
status: "idle" | "active" | "canceled" | "success" | "failure" | "skipped";
started_on: string | null;
ended_on: string | null;
}[];
deployment_trigger: {
metadata: {
/** Commit hash of the deployment trigger metadata for the pages project */
commit_hash: string;
};
};
}

interface OutputEntryVersionUpload extends OutputEntryBase<"version-upload"> {
Expand Down
8 changes: 8 additions & 0 deletions packages/wrangler/src/pages/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,14 @@ ${failureMessage}`,
url: deploymentResponse.url,
alias,
environment: deploymentResponse.environment,
project_name: deploymentResponse.project_name,
production_branch: deploymentResponse.production_branch,
stages: deploymentResponse.stages,
deployment_trigger: {
metadata: {
commit_hash: deploymentResponse.deployment_trigger.metadata.commit_hash,
},
},
});

await metrics.sendMetricsEvent("create pages deployment");
Expand Down

0 comments on commit 1ece459

Please sign in to comment.