aboutsummaryrefslogtreecommitdiffstats
path: root/.github/workflows
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2022-03-13 15:21:19 -0400
committerKevin O'Connor <kevin@koconnor.net>2022-03-13 17:13:56 -0400
commit2f8f99acae74e67f925d535a9a9a2ef172d392c5 (patch)
tree897bfcc5d968bd47c74d918ee33a3340921dbff2 /.github/workflows
parent341e56dcea178ec2b269528ba1ad2978cfdc4b15 (diff)
downloadkutter-2f8f99acae74e67f925d535a9a9a2ef172d392c5.tar.gz
kutter-2f8f99acae74e67f925d535a9a9a2ef172d392c5.tar.xz
kutter-2f8f99acae74e67f925d535a9a9a2ef172d392c5.zip
workflows: Mark inactive github PRs with "reviewer needed"
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to '.github/workflows')
-rw-r--r--.github/workflows/stale-issue-bot.yaml35
1 files changed, 35 insertions, 0 deletions
diff --git a/.github/workflows/stale-issue-bot.yaml b/.github/workflows/stale-issue-bot.yaml
index 8cc3062f..83f91244 100644
--- a/.github/workflows/stale-issue-bot.yaml
+++ b/.github/workflows/stale-issue-bot.yaml
@@ -108,6 +108,41 @@ jobs:
state: 'closed'
});
}
+ # Mark unassigned PRs that are idle for 2 weeks
+ mark_reviewer_needed:
+ if: github.repository == 'Klipper3d/klipper'
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/github-script@v6
+ with:
+ script: |
+ const create_check = new Date("2022-03-01T00:00:00Z").getTime();
+ const expireMillis = 1000 * 60 * 60 * 24 * 14;
+ const curtime = new Date().getTime();
+ const pulls_req = await github.rest.pulls.list({
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ per_page: 100,
+ page: 1
+ });
+ for (const pr of pulls_req.data.values()) {
+ const createtime = new Date(pr.created_at).getTime();
+ if (createtime < create_check)
+ continue;
+ const updatetime = new Date(pr.updated_at).getTime();
+ if (curtime < updatetime + expireMillis)
+ continue;
+ if (pr.labels.length > 0)
+ continue;
+ if (pr.assignees.length > 0)
+ continue;
+ await github.rest.issues.addLabels({
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ issue_number: pr.number,
+ labels: ['reviewer needed']
+ });
+ }
# Close tickets marked with "resolved" label
close_resolved:
if: github.repository == 'Klipper3d/klipper'