aboutsummaryrefslogtreecommitdiffstats
path: root/.github/workflows/close-invalid-bot.yaml
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2021-08-17 12:33:45 -0400
committerKevin O'Connor <kevin@koconnor.net>2021-08-17 12:33:45 -0400
commitdd1b1f496c6a4bdd394fa5f8665613b719d5c11e (patch)
tree516a13d49e2c2dd3bfa72cb193467fdd8a0380d2 /.github/workflows/close-invalid-bot.yaml
parent1aa4becc60b5ef5f18f3ad6bc419e05ce1eb2e12 (diff)
downloadkutter-dd1b1f496c6a4bdd394fa5f8665613b719d5c11e.tar.gz
kutter-dd1b1f496c6a4bdd394fa5f8665613b719d5c11e.tar.xz
kutter-dd1b1f496c6a4bdd394fa5f8665613b719d5c11e.zip
workflows: Merge close-invalid-bot into stale-issue-bot
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to '.github/workflows/close-invalid-bot.yaml')
-rw-r--r--.github/workflows/close-invalid-bot.yaml33
1 files changed, 0 insertions, 33 deletions
diff --git a/.github/workflows/close-invalid-bot.yaml b/.github/workflows/close-invalid-bot.yaml
deleted file mode 100644
index bec78b4e..00000000
--- a/.github/workflows/close-invalid-bot.yaml
+++ /dev/null
@@ -1,33 +0,0 @@
-# Close issues marked as "not on github"
-name: "Close issues marked as 'not on github'"
-on:
- schedule:
- - cron: '0 */6 * * *'
-jobs:
- close_issues:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/github-script@v3
- with:
- script: |
- const issues = await github.issues.listForRepo({
- owner: context.repo.owner,
- repo: context.repo.repo,
- state: 'open',
- labels: 'not on github',
- per_page: 100,
- page: 1
- });
- const expireMillis = 1000 * 60 * 60 * 36;
- const curtime = new Date().getTime();
- for (var issue of issues.data.values()) {
- const updatetime = new Date(issue.updated_at).getTime();
- if (curtime < updatetime + expireMillis)
- continue;
- await github.issues.update({
- owner: context.repo.owner,
- repo: context.repo.repo,
- issue_number: issue.number,
- state: 'closed'
- });
- }