Skip to content

Commit

Permalink
add actions to auto-close issue and auto-comment on issues (#357)
Browse files Browse the repository at this point in the history
  • Loading branch information
qishipengqsp authored Jan 3, 2024
1 parent 41656d4 commit 8aec163
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 3 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/issue_auto_close.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Usage:
# Close the issue automatically when the issue is inactive for a period of time,
# including the ones labelled as "Reproduction Needed" or "More Info Needed".

name: Issue Auto Close

on:
schedule:
- cron: "0 10 * * *" # scan the issues at 10:00 every day

jobs:
close-issues:
runs-on: ubuntu-latest
steps:
- name: Needs more info
uses: actions-cool/issues-helper@main
with:
actions: 'close-issues'
labels: 'More Info Needed'
inactive-day: 15
body: |
Since this issue was labeled as "More Info Needed" but no response has been received for 15 days. Now the issue is closed. Please feel free to create a new one with more info if you have more questions.
由于该 issue 被标记为需要更多信息,却 15 天未收到回应。现关闭 issue,若有任何问题,可另开 issue 并提供更多信息。
42 changes: 42 additions & 0 deletions .github/workflows/issue_label.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Usage:
# Auto comment on the issue after labelled

name: Issue Labelled

on:
issues:
types: [labeled]

permissions:
contents: read

jobs:
issue-labeled:
permissions:
issues: write # for actions-cool/issues-helper to update issues
pull-requests: write # for actions-cool/issues-helper to update PRs
runs-on: ubuntu-latest
steps:
- name: help wanted
if: github.event.label.name == 'Help Wanted'
uses: actions-cool/issues-helper@v3
with:
actions: 'create-comment'
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.issue.number }}
body: |
Hello @${{ github.event.issue.user.login }}, thank you for your proposal/feedback. Now the problem/reason is clear. Welcome to [contribute a Pull Request](https://github.com/TuGraph-family/tugraph-db/blob/master/docs/en-US/source/6.contributor-manual/1.contributing.md) for it. We will review it ASAP. Looking forward to your contribution!
你好 @${{ github.event.issue.user.login }},感谢你的提议/反馈,现在问题已经明确。欢迎直接在此仓库 [贡献一个 Pull Request](https://github.com/TuGraph-family/tugraph-db/blob/master/docs/zh-CN/source/6.contributor-manual/1.contributing.md) 来解决这个问题,我们会尽快进行 Review,期待您的贡献。
- name: More Info Needed
if: github.event.label.name == 'More Info Needed'
uses: actions-cool/issues-helper@v3
with:
actions: 'create-comment'
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.issue.number }}
body: |
Hello @${{ github.event.issue.user.login }}. Please provide more info for debugging. Issues labeled by `More Info Needed` will be closed if no activities in 7 days.
你好 @${{ github.event.issue.user.login }}, 我们需要你提供更多信息以便于排查问题。7 天内未跟进此 issue 将会被自动关闭。
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
name: Issue Closed
# Usage:
# Create a comment when the issue is closed, reminding the user to star the repo.

name: Issue Pre Close

on:
issues:
types: [closed]

jobs:
issue-closed:
issue-pre-close:
runs-on: ubuntu-latest
steps:
- name: check-star
Expand All @@ -20,4 +23,5 @@ jobs:
issue-number: ${{ github.event.issue.number }}
body: |
Hello @${{ github.event.issue.user.login }}, please star this repo if you find it useful! Thanks :star:!
你好 @${{ github.event.issue.user.login }}。如果该仓库对你有用,可以在仓库右上角 star 一下,感谢你的 :star:!
你好 @${{ github.event.issue.user.login }}。如果这个项目帮助到你,可以在仓库右上角 star 一下,感谢你的 :star:!

0 comments on commit 8aec163

Please sign in to comment.