Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#1107 Create issue-update-reminder.yml #1187

Closed
wants to merge 13 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions .github/workflows/issue-update-reminder.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Issue Update Reminder

on:
schedule:
- cron: '0 0 * * *' # Run daily at midnight

jobs:
issue-update-reminder:
runs-on: ubuntu-latest

steps:
- name: Check issue activity
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const daysInactive = 8;
const label = 'Status: Update Requested';
const cutoffTime = new Date(Date.now() - daysInactive * 24 * 60 * 60 * 1000);

const issues = await github.rest.issues.listForRepo({
owner: context.repo.owner,
repo: context.repo.repo,
state: 'open',
assignee: '*',
});

for (const issue of issues.data) {
const lastCommentTime = new Date(issue.updated_at);

if (lastCommentTime < cutoffTime) {
const assignees = issue.assignees.map(assignee => `@${assignee.login}`).join(', ');

const commentBody = `Hey ${assignees}! Thanks again for taking this issue.

Time for an update! Please comment the following update:
**Progress:** What's the status of the project? What have you done and what still needs to be done?
**Estimated Time to Completion (ETC):** When do you estimate to be finished?
**Blockers:** Anything preventing you from finishing?

Thanks again!
`;

await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue.number,
labels: [label],
});

await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue.number,
body: commentBody,
});
}
}
Loading