From 1bf10a507e461311adb921140405a36836180260 Mon Sep 17 00:00:00 2001 From: Kuitos Date: Tue, 15 Aug 2023 12:17:58 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7add=20issue=20checker=20workflow=20?= =?UTF-8?q?(#2594)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/issue-checker.yml | 37 +++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/issue-checker.yml diff --git a/.github/workflows/issue-checker.yml b/.github/workflows/issue-checker.yml new file mode 100644 index 000000000..ee4e4794f --- /dev/null +++ b/.github/workflows/issue-checker.yml @@ -0,0 +1,37 @@ +name: Issue Checker + +on: + issues: + types: [opened, edited] + +jobs: + check-permission: + runs-on: ubuntu-latest + outputs: + require-result: ${{ steps.checkUser.outputs.require-result }} + steps: + - uses: actions-cool/check-user-permission@v2 + id: checkUser + with: + require: 'write' + + check-open: + runs-on: ubuntu-latest + needs: check-permission + if: needs.check-permission.outputs.require-result == 'false' && github.event.issue.state == 'open' && contains(github.event.issue.title, '[Feature Request]') == false && contains(github.event.issue.body, 'https://github.com') == false && contains(github.event.issue.body, 'https://stackblitz.com') == false && contains(github.event.issue.body, 'https://codesandbox.io') == false + steps: + - uses: actions-cool/maintain-one-comment@v3 + with: + body: 由于缺乏足够的信息(github、stackblitz、codesandbox等可复现仓库),我们暂时关闭了该 Issue。请修改(不要回复) Issue 提供[最小重现](https://stackoverflow.com/help/minimal-reproducible-example)以重新开启。谢谢。 + - uses: actions-cool/issues-helper@v3 + with: + actions: close-issue + + check-close: + runs-on: ubuntu-latest + needs: check-permission + if: needs.check-permission.outputs.require-result == 'false' && github.event.issue.state == 'closed' && (contains(github.event.issue.body, 'https://github.com') == true || contains(github.event.issue.body, 'https://stackblitz.com') == true || contains(github.event.issue.body, 'https://codesandbox.io') == true) + steps: + - uses: actions-cool/issues-helper@v3 + with: + actions: open-issue