Skip to content

Commit 91abaa2

Browse files
committed
Posts the time left instead of the total time
1 parent a18c966 commit 91abaa2

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

index.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ async function main() {
103103
// in it that it will be unassigned in the near future.
104104
var unassignedIssues = [];
105105
var warnedIssues = [];
106-
// issuesAry.forEach(async issue => {
107106
for (var i = 0; i < issuesAry.length; i++) {
108107
const issue = issuesAry[i];
109108
const timeInactiveInHours = await getTimeInactiveInHours(issue);
@@ -167,10 +166,11 @@ async function main() {
167166
if (comments.data.length === 0 ||
168167
comments.data[comments.data.length - 1].user.login !== 'github-actions[bot]'
169168
) {
169+
const willBeUnassignedInHours = unassignInactiveInHours - timeInactiveInHours;
170170
const body = `This issue has been inactive for ${timeInactiveInHours} ` +
171171
`hours (${(timeInactiveInHours/24).toFixed(2)} days) ` +
172-
`and will be automatically unassigned after ${unassignInactiveInHours} ` +
173-
`hours (${(unassignInactiveInHours/24).toFixed(2)} days).`;
172+
`and will be automatically unassigned after ${willBeUnassignedInHours} ` +
173+
`more hours (${(willBeUnassignedInHours/24).toFixed(2)} days).`;
174174
try {
175175
await octokit.issues.createComment({
176176
owner: repoOwner,
@@ -186,9 +186,7 @@ async function main() {
186186
}
187187
}
188188
}
189-
// });
190189

191-
console.log(unassignedIssues);
192190
core.setOutput('unassigned_issues', unassignedIssues.join(','));
193191
core.setOutput('warned_issues', warnedIssues.join(','));
194192
}

0 commit comments

Comments
 (0)