diff --git a/.changeset/curly-dryers-admire.md b/.changeset/curly-dryers-admire.md new file mode 100644 index 000000000000..bb6538ff1d31 --- /dev/null +++ b/.changeset/curly-dryers-admire.md @@ -0,0 +1,5 @@ +--- +"wrangler": patch +--- + +feat: Add production_branch, project_name and deployment_trigger to pages deploy detailed artifact for wrangler-action pages parity diff --git a/packages/wrangler/src/__tests__/output.test.ts b/packages/wrangler/src/__tests__/output.test.ts index 6124c72660eb..82e6202b2379 100644 --- a/packages/wrangler/src/__tests__/output.test.ts +++ b/packages/wrangler/src/__tests__/output.test.ts @@ -193,6 +193,13 @@ describe("writeOutput()", () => { url: "test.com", alias: "dev.com", environment: "production", + production_branch: "production-branch", + project_name: "mock-project-name", + deployment_trigger: { + metadata: { + commit_hash: "bc286bd30cf12b7fdbce046be6e53ce12ae1283d", + }, + }, }); const outputFilePaths = readdirSync("output"); @@ -215,6 +222,13 @@ describe("writeOutput()", () => { url: "test.com", alias: "dev.com", environment: "production", + production_branch: "production-branch", + project_name: "mock-project-name", + deployment_trigger: { + metadata: { + commit_hash: "bc286bd30cf12b7fdbce046be6e53ce12ae1283d", + }, + }, }, ]); }); diff --git a/packages/wrangler/src/output.ts b/packages/wrangler/src/output.ts index 7a85768edabb..db17d11e90dc 100644 --- a/packages/wrangler/src/output.ts +++ b/packages/wrangler/src/output.ts @@ -118,6 +118,16 @@ 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; + deployment_trigger: { + metadata: { + /** Commit hash of the deployment trigger metadata for the pages project */ + commit_hash: string; + }; + }; } interface OutputEntryVersionUpload extends OutputEntryBase<"version-upload"> { diff --git a/packages/wrangler/src/pages/deploy.ts b/packages/wrangler/src/pages/deploy.ts index e8a3e85298fc..ddaf0368ce1e 100644 --- a/packages/wrangler/src/pages/deploy.ts +++ b/packages/wrangler/src/pages/deploy.ts @@ -454,6 +454,14 @@ ${failureMessage}`, url: deploymentResponse.url, alias, environment: deploymentResponse.environment, + project_name: deploymentResponse.project_name, + production_branch: deploymentResponse.production_branch, + deployment_trigger: { + metadata: { + commit_hash: + deploymentResponse.deployment_trigger?.metadata?.commit_hash ?? "", + }, + }, }); await metrics.sendMetricsEvent("create pages deployment");