aboutsummaryrefslogtreecommitdiffstats
path: root/.github
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
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')
-rw-r--r--.github/workflows/close-invalid-bot.yaml33
-rw-r--r--.github/workflows/stale-issue-bot.yaml36
2 files changed, 33 insertions, 36 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'
- });
- }
diff --git a/.github/workflows/stale-issue-bot.yaml b/.github/workflows/stale-issue-bot.yaml
index 1d6534fa..470b4812 100644
--- a/.github/workflows/stale-issue-bot.yaml
+++ b/.github/workflows/stale-issue-bot.yaml
@@ -1,9 +1,10 @@
-# Enable the github stale issue bot tracker
-name: "Close stale issues"
+# Close and warn on tickets that have become stale
+name: "Close stale tickets"
on:
schedule:
- - cron: '0 0 * * *'
+ - cron: '0 */12 * * *'
jobs:
+ # Check for stale issues (no updates in 5 weeks)
stale:
runs-on: ubuntu-latest
steps:
@@ -29,6 +30,35 @@ jobs:
exempt-issue-labels: 'enhancement,bug'
days-before-stale: 35
days-before-close: 7
+ # Close tickets marked with "not on github" label
+ close_not_on_github:
+ 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'
+ });
+ }
+ # Close tickets marked with "resolved" label
close_resolved:
runs-on: ubuntu-latest
steps: