forked from UppuluriKalyani/ML-Nexus
-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (32 loc) · 1.14 KB
/
issue-reminder.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
name: Issue Reminder
on:
schedule:
- cron: '15 4 * * *'
jobs:
remind-issues:
runs-on: ubuntu-latest
steps:
- name: Check for old issues
uses: actions/github-script@v6
with:
script: |
const { data: issues } = await github.issues.listForRepo({
owner: context.repo.owner,
repo: context.repo.repo,
state: 'open',
per_page: 100, // Adjust as necessary
});
const now = new Date();
const sevenDaysAgo = new Date(now.setDate(now.getDate() - 7));
for (const issue of issues) {
const updatedAt = new Date(issue.updated_at);
if (updatedAt < sevenDaysAgo) {
const commentBody = `🚨 Reminder: This issue has been open for over 7 days without updates. Please take action!`;
await github.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue.number,
body: commentBody,
});
}
}