Skip to content

Commit

Permalink
Merge branch 'Niketkumardheeryan:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
ruhi47 authored Nov 25, 2024
2 parents d5bcf97 + 3dff25b commit 3840bcd
Show file tree
Hide file tree
Showing 78 changed files with 53,941 additions and 3,268 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/issue-reminder.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Issue Reminder

on:
schedule:
# Runs every day at 8 AM
- cron: '0 8 * * *'

jobs:
remind-stale-issues:
runs-on: ubuntu-latest

steps:
- name: Check out the repository
uses: actions/checkout@v3

- name: Find and remind stale issues
uses: actions/github-script@v6
with:
script: |
const daysBeforeReminder = 7;
const staleDate = new Date(Date.now() - daysBeforeReminder * 24 * 60 * 60 * 1000);
const { data: issues } = await github.rest.issues.listForRepo({
owner: context.repo.owner,
repo: context.repo.repo,
state: 'open',
since: staleDate.toISOString(),
});
const staleIssues = issues.filter(issue => new Date(issue.updated_at) < staleDate);
for (const issue of staleIssues) {
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue.number,
body: `👋 This issue hasn't been updated in over ${daysBeforeReminder} days. Please check in to see if it is still relevant!`,
});
}
if (staleIssues.length === 0) {
console.log('No stale issues found. All issues are up-to-date.');
} else {
console.log(`${staleIssues.length} stale issue(s) found and reminded.`);
}
Loading

0 comments on commit 3840bcd

Please sign in to comment.