Skip to content

Commit 94b2b9c

Browse files
authored
fix: correct days-to-merge log output to display actual days (#324)
The daysToMerge/daysToClose values are stored in seconds (legacy naming), but the log output was displaying raw seconds as if they were days. This made values like -398601 appear as bugs when they actually represented about -4.6 days correctly. Now converts to actual days before logging for clarity.
1 parent 78f605a commit 94b2b9c

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/helpers/pullRequestProcessor.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,11 +144,13 @@ export async function processPullRequests() {
144144

145145
prResult.daysToMerge = pullRequestData.times.daysToMerge || null;
146146
prResult.daysToClose = pullRequestData.times.daysToClose || null;
147-
const actionDays =
147+
// Note: daysToMerge/daysToClose are actually in seconds (legacy naming)
148+
const actionSeconds =
148149
pullRequestData.times.daysToMerge ||
149150
pullRequestData.times.daysToClose;
151+
const actionDays = actionSeconds / 86400; // Convert to actual days
150152
console.log(
151-
`Days to ${pullRequestData.times.action}: ${actionDays}`
153+
`Days to ${pullRequestData.times.action}: ${actionDays.toFixed(2)}`
152154
);
153155

154156
// Set GitHub status for this pull request

0 commit comments

Comments
 (0)