Skip to content

Commit

Permalink
fix: skip issues correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
kellertk committed Apr 24, 2020
1 parent be318db commit 1c718ea
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/entrypoint.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,11 @@ async function processIssues(client, args) {
if (isLabeled(issue, staleLabel)) {
log.debug(`issue contains the stale label`);
const lastCommentTime = getLastCommentTime(issueTimelineEvents);
const staleLabelTime = getLastLabelTime(issueTimelineEvents, staleLabel);
const stLabelTime = getLastLabelTime(issueTimelineEvents, staleLabel);
const sTime = new Date(
lastCommentTime + MS_PER_DAY * args.daysBeforeClose
);
const staleLabelTime = stLabelTime === undefined ? sTime : stLabelTime;
if (lastCommentTime > staleLabelTime) {
log.debug('issue was commented on after the label was applied');
if (args.dryrun) {
Expand Down
4 changes: 2 additions & 2 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ module.exports.getLastLabelTime = (events, label) => {
log.warn(
`Could not find a ${label} label event in this issue's timeline. Was this label renamed?`
);
log.warn('Defaulting the label time to now so we skip over this issue');
return new Date(Date.now());
log.warn('Skipping over this issue');
return undefined;
}
};

Expand Down

0 comments on commit 1c718ea

Please sign in to comment.