Skip to content

Commit cec57bc

Browse files
Hotfix/cleanup inactive issues (#489)
* feat: adicionar automação para gerenciar PRs inativos com GitHub Actions * chore: adiciona teste para o stale * chore: remove arquivo hello_world * chore: remove arquivo stale * fix: corrigir busca de comentários nas issues para evitar erro de tipo
1 parent 0fadc37 commit cec57bc

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

.github/workflows/cleanup-inactive-issues.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,16 @@ jobs:
3232
const daysInactive = Math.floor((now - lastUpdate) / (1000 * 60 * 60 * 24));
3333
3434
if (daysInactive >= inactiveDays && issue.assignees.length > 0) {
35-
const warningComment = issue.comments.some(comment => comment.body.includes('[PT-BR] Os assignees serão removidos. \n\n[EN] The assignees will be removed.'));
35+
const comments = await github.paginate(github.rest.issues.listComments, {
36+
owner: context.repo.owner,
37+
repo: context.repo.repo,
38+
issue_number: issue.number
39+
});
40+
41+
const warningComment = comments.some(comment =>
42+
comment.body.includes('[PT-BR] Os assignees serão removidos.') ||
43+
comment.body.includes('[EN] The assignees will be removed.')
44+
);
3645
3746
if (!warningComment) {
3847
await github.rest.issues.createComment({
@@ -58,4 +67,3 @@ jobs:
5867
});
5968
}
6069
}
61-

0 commit comments

Comments
 (0)