feat: Add Docker image push notification in commit message extraction

- Enhanced the extractCommitMessage function to include a specific message format for Docker image pushes when the user-agent indicates a Go-http-client. This improves clarity in deployment notifications by providing detailed information about the repository and the pusher.
This commit is contained in:
Mauricio Siu 2025-03-23 04:12:08 -06:00
parent b59597630c
commit 048c8ffc11

View File

@ -272,6 +272,12 @@ export const extractCommitMessage = (headers: any, body: any) => {
: "NEW COMMIT";
}
if (headers["user-agent"]?.includes("Go-http-client")) {
if (body.push_data && body.repository) {
return `Docker image pushed: ${body.repository.repo_name}:${body.push_data.tag} by ${body.push_data.pusher}`;
}
}
return "NEW CHANGES";
};