Browse Source

Update workflows

Bobholamovic 2 years ago
parent
commit
af00bfb9cf
3 changed files with 72 additions and 0 deletions
  1. 20 0
      .github/workflows/remove_triage.yml
  2. 31 0
      .github/workflows/stale.yml
  3. 21 0
      .github/workflows/triage.yml

+ 20 - 0
.github/workflows/remove_triage.yml

@@ -0,0 +1,20 @@
+name: Remove triage label
+on:
+  issues:
+    types:
+      - assigned
+jobs:
+  remove_label:
+    runs-on: ubuntu-latest
+    permissions:
+      issues: write
+    steps:
+      - uses: actions/github-script@v6
+        with:
+          script: |
+            github.rest.issues.removeLabel({
+              issue_number: context.issue.number,
+              owner: context.repo.owner,
+              repo: context.repo.repo,
+              name: ["triage"]
+            })

+ 31 - 0
.github/workflows/stale.yml

@@ -0,0 +1,31 @@
+# This workflow warns and then closes issues and PRs that have had no activity for a specified amount of time.
+#
+# You can adjust the behavior by modifying this file.
+# For more information, see:
+# https://github.com/actions/stale
+name: Mark stale issues and pull requests
+
+on:
+  schedule:
+  - cron: '0 17 * * *'
+
+jobs:
+  stale:
+
+    runs-on: ubuntu-latest
+    permissions:
+      issues: write
+      pull-requests: none
+
+    steps:
+    - uses: actions/stale@v5
+      with:
+        repo-token: ${{ secrets.GITHUB_TOKEN }}
+        stale-issue-message: 'This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.'
+        stale-issue-label: 'stale'
+        close-issue-reason: 'completed'
+        exempt-issue-labels: 'bug, dependencies, documentation, enhancement, WIP'
+        operations-per-run: 900
+        days-before-pr-stale: -1
+        days-before-pr-close: -1
+        ascending: true

+ 21 - 0
.github/workflows/triage.yml

@@ -0,0 +1,21 @@
+name: Label issues
+on:
+  issues:
+    types:
+      - reopened
+      - opened
+jobs:
+  label_issues:
+    runs-on: ubuntu-latest
+    permissions:
+      issues: write
+    steps:
+      - uses: actions/github-script@v6
+        with:
+          script: |
+            github.rest.issues.addLabels({
+              issue_number: context.issue.number,
+              owner: context.repo.owner,
+              repo: context.repo.repo,
+              labels: ["triage"]
+            })