Skip to content

Commit

Permalink
Commit timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
adamnolte committed Oct 1, 2024
1 parent 5a20062 commit 2ae507f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/util/ci.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ const zCodefreshEventSchema = z.object({
default_branch: z.string(),
}),
head_commit: z.object({
timestamp: z.string(),
author: z.object({
name: z.string(),
email: z.string(),
Expand Down Expand Up @@ -210,7 +211,9 @@ async function makeCodefreshCIContext(): Promise<CIContext> {
commitAuthorEmail: parsedEvent?.head_commit.author.email ?? null,
commitCommitterName: env.CF_COMMIT_AUTHOR,
commitCommitterEmail: parsedEvent?.head_commit.committer.email ?? null,
commitCommittedDate: new Date().toISOString(),
commitCommittedDate: parsedEvent?.head_commit.timestamp
? new Date(parsedEvent.head_commit.timestamp).toISOString()
: new Date().toISOString(),
pullRequestNumber:
env.CF_PULL_REQUEST_NUMBER !== null &&
env.CF_PULL_REQUEST_NUMBER !== undefined
Expand Down

0 comments on commit 2ae507f

Please sign in to comment.