Skip to content

Commit

Permalink
feat: Add additional fields to pages deploy detailed artifact for wra…
Browse files Browse the repository at this point in the history
…ngler-action pages parity
  • Loading branch information
Maximo-Guk committed Nov 14, 2024
1 parent b6cbfbd commit 1cf78d5
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/curly-dryers-admire.md
Original file line number Diff line number Diff line change
@@ -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
14 changes: 14 additions & 0 deletions packages/wrangler/src/__tests__/output.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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",
},
},
},
]);
});
Expand Down
10 changes: 10 additions & 0 deletions packages/wrangler/src/output.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"> {
Expand Down
7 changes: 7 additions & 0 deletions packages/wrangler/src/pages/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,13 @@ ${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");
Expand Down

0 comments on commit 1cf78d5

Please sign in to comment.