Issue Reminder #13
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | |
}); | |
} | |
} |