ci: add issue helper (#4779)

This commit is contained in:
三咲智子 2021-12-10 22:47:19 +08:00 committed by GitHub
parent 13375ef887
commit 31ca8e0560
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 170 additions and 0 deletions

16
.github/workflows/issue-duplicate.yml vendored Normal file
View File

@ -0,0 +1,16 @@
name: Issue Mark Duplicate
on:
issue_comment:
types: [created, edited]
jobs:
mark-duplicate:
runs-on: ubuntu-latest
steps:
- name: mark-duplicate
uses: actions-cool/issues-helper@v2
with:
actions: 'mark-duplicate'
token: ${{ secrets.GITHUB_TOKEN }}
close-issue: true

50
.github/workflows/issue-inactive.yml vendored Normal file
View File

@ -0,0 +1,50 @@
name: Issue Inactive
on:
schedule:
- cron: '0 8 * * *'
jobs:
close-issues:
runs-on: ubuntu-latest
steps:
- name: need reproduction
uses: actions-cool/issues-helper@v2
with:
actions: 'close-issues'
labels: 'need reproduction'
inactive-day: 3
- name: needs more info
uses: actions-cool/issues-helper@v2
with:
actions: 'close-issues'
labels: 'needs more info'
inactive-day: 3
body: |
Since the issue was labeled with `needs-more-info`, but no response in 3 days. This issue will be closed. If you have any questions, you can comment and reply.
由于该 issue 被标记为需要更多信息,却 3 天未收到回应。现关闭 issue若有任何问题可评论回复。
lock-issues:
runs-on: ubuntu-latest
steps:
- name: lock-issues
uses: actions-cool/issues-helper@v2
with:
actions: 'lock-issues'
token: ${{ secrets.GITHUB_TOKEN }}
issue-state: closed
inactive-day: 30
body: |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
此 issue 已被自动锁定,因为关闭后没有任何近期活动。如果有相关 bug请重新创建一个新 issue。
check-inactive:
runs-on: ubuntu-latest
steps:
- name: check-inactive
uses: actions-cool/issues-helper@v2
with:
actions: 'check-inactive'
inactive-day: 30

42
.github/workflows/issue-labeled.yml vendored Normal file
View File

@ -0,0 +1,42 @@
name: Issue Labeled
on:
issues:
types: [labeled]
jobs:
reply-labeled:
runs-on: ubuntu-latest
steps:
- name: contribution welcome
if: github.event.label.name == 'contribution welcome' || github.event.label.name == 'help wanted'
uses: actions-cool/issues-helper@v2
with:
actions: 'create-comment'
issue-number: ${{ github.event.issue.number }}
body: |
Hello @${{ github.event.issue.user.login }}. We totally like your proposal/feedback, welcome to [send us a Pull Request](https://help.github.com/en/articles/creating-a-pull-request) for it. Please send your Pull Request to `dev` branch, fill the [Pull Request Template](https://github.com/element-plus/element-plus/blob/dev/.github/pull_request_template.md) here, provide changelog/TypeScript/documentation/test cases if needed and make sure CI passed, we will review it soon. We appreciate your effort in advance and looking forward to your contribution!
你好 @${{ github.event.issue.user.login }},我们完全同意你的提议/反馈,欢迎直接在此仓库 [创建一个 Pull Request](https://help.github.com/en/articles/creating-a-pull-request) 来解决这个问题。请将 Pull Request 发到 `dev 分支,务必填写 Pull Request 内的[预设模板](https://github.com/element-plus/element-plus/blob/dev/.github/pull_request_template.md),提供改动所需相应的 changelog、TypeScript 定义、测试用例、文档等,并确保 CI 通过,我们会尽快进行 Review提前感谢和期待您的贡献。
- name: need reproduction
if: github.event.label.name == 'need reproduction'
uses: actions-cool/issues-helper@v2
with:
actions: 'create-comment'
issue-number: ${{ github.event.issue.number }}
body: |
Hello @${{ github.event.issue.user.login }}. Please provide an online reproduction demo by clicking this [link](https://codepen.io/iamkun/pen/YzWMaVr) or a minimal GitHub repository. Issues marked with `need reproduction` will be closed if they have no activity within 3 days.
你好 @${{ github.event.issue.user.login }}, 我们需要你提供一个在线的重现实例以便于我们帮你排查问题。可以通过点击 [此处](https://codepen.io/iamkun/pen/YzWMaVr) 创建或者提供一个最小化的 GitHub 仓库。3 天内未跟进此 issue 将会被自动关闭。
- name: invalid
if: github.event.label.name == 'invalid'
uses: actions-cool/issues-helper@v2
with:
actions: 'create-comment, close-issue'
issue-number: ${{ github.event.issue.number }}
body: |
Hello @${{ github.event.issue.user.login }}, your issue has been closed because it does not conform to our issue requirements. Please use the [Issue Helper](https://elementui.github.io/issue-generator/#/en-US?repo=element-plus) to create an issue, thank you!
你好 @${{ github.event.issue.user.login }},为了能够进行高效沟通,我们对 issue 有一定的格式要求,你的 issue 因为不符合要求而被自动关闭。你可以通过 [issue 助手](https://elementui.github.io/issue-generator/#/en-US?repo=element-plus) 来创建 issue 以方便我们定位错误。谢谢配合!

27
.github/workflows/issue-open-check.yml vendored Normal file
View File

@ -0,0 +1,27 @@
name: Issue Open Check
on:
issues:
types: [opened]
jobs:
issue-open-check:
runs-on: ubuntu-latest
steps:
- uses: actions-cool/check-user-permission@v1
id: checkUser
with:
require: 'write'
check-bot: true
- name: check invalid
if: (contains(github.event.issue.body, '<!-- generated by') == false) && (steps.checkUser.outputs.result == 'false')
uses: actions-cool/issues-helper@v2
with:
actions: 'create-comment,add-labels,close-issue'
issue-number: ${{ github.event.issue.number }}
labels: 'invalid'
body: |
Hello @${{ github.event.issue.user.login }}, your issue has been closed because it does not conform to our issue requirements. Please use the [Issue Helper](https://elementui.github.io/issue-generator/#/en-US?repo=element-plus) to create an issue, thank you!
你好 @${{ github.event.issue.user.login }},为了能够进行高效沟通,我们对 issue 有一定的格式要求,你的 issue 因为不符合要求而被自动关闭。你可以通过 [issue 助手](https://elementui.github.io/issue-generator/#/en-US?repo=element-plus) 来创建 issue 以方便我们定位错误。谢谢配合!

View File

@ -0,0 +1,19 @@
name: Issue Remove Inactive
on:
issues:
types: [edited]
issue_comment:
types: [created, edited]
jobs:
issue-remove-inactive:
runs-on: ubuntu-latest
steps:
- name: remove inactive
if: github.event.issue.state == 'open' && github.actor == github.event.issue.user.login
uses: actions-cool/issues-helper@v2
with:
actions: 'remove-labels'
issue-number: ${{ github.event.issue.number }}
labels: 'inactive'

16
.github/workflows/issue-statistics.yml vendored Normal file
View File

@ -0,0 +1,16 @@
name: Issue Month Statistics
on:
schedule:
- cron: '0 1 1 * *'
jobs:
month-statistics:
runs-on: ubuntu-latest
steps:
- name: month-statistics
uses: actions-cool/issues-helper@v2
with:
actions: 'month-statistics'
token: ${{ secrets.GITHUB_TOKEN }}
count-lables: 'true'