Skip to content

Commit

Permalink
[no ci] add basic issue management workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
roflmuffin committed Feb 22, 2024
1 parent 48fa9ca commit 62ba298
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/issues-needs-author-action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Add comment for needs-author-action

on:
issues:
types:
- labeled

jobs:
add-comment:
if: github.event.label.name == 'needs-author-action'
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: Add comment
run: gh issue comment "$NUMBER" --body "$BODY"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
NUMBER: ${{ github.event.issue.number }}
BODY: This issue has been marked `needs-author-action` and may be missing some important information.
29 changes: 29 additions & 0 deletions .github/workflows/issues-remove-needs-author-action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Add comment for needs-author-action

on:
issue_comment:
types:
- created

jobs:
add-comment:
if: (github.event.sender.id == github.event.issue.user.id) && contains(github.event.issue.labels.*.name, 'needs-author-action')
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: Remove label
run: gh issue edit "$NUMBER" --remove-label "$LABELS"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
NUMBER: ${{ github.event.issue.number }}
LABELS: needs-author-action

- name: Add label
run: gh issue edit "$NUMBER" --add-label "$LABELS"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
NUMBER: ${{ github.event.issue.number }}
LABELS: needs-further-triage
24 changes: 24 additions & 0 deletions .github/workflows/issues-stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Mark stale issues

on:
schedule:
- cron: '28 3 * * *'

jobs:
stale:

runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write

steps:
- uses: actions/stale@v5
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-issue-stale: 14
days-before-issue-close: 14
stale-issue-label: 'no-recent-activity'
only-labels: 'needs-author-action'
stale-issue-message: 'This issue has been automatically marked `no-recent-activity` because it has not had any activity for 14 days. It will be closed if no further activity occurs within 14 more days. Any new comment (by anyone, not necessarily the author) will remove no-recent-activity.'
close-issue-message: 'This issue will now be closed since it had been marked `no-recent-activity` but received no further activity in the past 14 days.'
20 changes: 20 additions & 0 deletions .github/workflows/issues-triage-new.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Label new issues

on:
issues:
types:
- reopened
- opened

jobs:
label_issues:
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- run: gh issue edit "$NUMBER" --add-label "$LABELS"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
NUMBER: ${{ github.event.issue.number }}
LABELS: untriaged

0 comments on commit 62ba298

Please sign in to comment.