diff --git a/.github/workflows/issue_close_question.yml b/.github/workflows/issue_close_question.yml index b518fb3b..5d5dd381 100644 --- a/.github/workflows/issue_close_question.yml +++ b/.github/workflows/issue_close_question.yml @@ -17,7 +17,7 @@ jobs: uses: actions-cool/issues-helper@v3 with: actions: 'close-issues' - labels: 'need info' + labels: 'invalid' inactive-day: 3 body: | 由于该 Issue 3 天未收到回应,现已被自动关闭,若有任何问题,可评论回复。 diff --git a/.github/workflows/issue_content_checker.yml b/.github/workflows/issue_content_checker.yml index 24fcd1e1..172c98f5 100644 --- a/.github/workflows/issue_content_checker.yml +++ b/.github/workflows/issue_content_checker.yml @@ -7,35 +7,49 @@ on: jobs: check-issue-content: runs-on: ubuntu-latest + steps: - - name: Add labels and comment based on issue content - id: process-issue + - name: Add invalid label + if: | + contains(github.event.issue.body, 'i.gkd.li/i/') == false && + contains(github.event.issue.body, '.zip') == false && + contains(github.event.issue.body, 'Uploading') == true && + contains(github.event.issue.body, 'i.gkd.li/snapshot/') == true uses: actions-cool/issues-helper@v3 with: + actions: 'add-labels' token: ${{ secrets.GITHUB_TOKEN }} issue-number: ${{ github.event.issue.number }} - actions: | - - type: condition - condition: "!contains(github.event.issue.body, 'i.gkd.li/i/') && !contains(github.event.issue.body, '.zip')" - do: | - - type: add-labels - labels: 'need info' - - type: create-comment - body: | - 你好 ${{ github.event.issue.user.login }},检测到您没有提供快照,请补充必要的快照! - - type: condition - condition: "contains(toLowerCase(github.event.issue.body), 'uploading')" - do: | - - type: add-labels - labels: 'need info' - - type: create-comment - body: | - 你好 ${{ github.event.issue.user.login }},检测到您的文件上传失败,请在上传时等待文件前面的 Uploading 消失后再提交! - - type: condition - condition: "contains(github.event.issue.body, 'i.gkd.li/snapshot/')" - do: | - - type: add-labels - labels: 'need info' - - type: create-comment - body: | - 你好 ${{ github.event.issue.user.login }},检测到您提供了他人无法访问的链接,请提供快照页面右上角生成的分享链接! + labels: 'invalid' + + - name: Comment for missing snapshots + if: | + contains(github.event.issue.body, 'i.gkd.li/') == false && + contains(github.event.issue.body, '.zip') == false + uses: actions-cool/issues-helper@v3 + with: + actions: 'create-comment' + token: ${{ secrets.GITHUB_TOKEN }} + issue-number: ${{ github.event.issue.number }} + body: | + 你好 ${{ github.event.issue.user.login }},检测到您没有提供快照,请补充必要的快照! + + - name: Comment for uploading failed + if: contains(github.event.issue.body, 'Uploading') == true + uses: actions-cool/issues-helper@v3 + with: + actions: 'create-comment' + token: ${{ secrets.GITHUB_TOKEN }} + issue-number: ${{ github.event.issue.number }} + body: | + 你好 ${{ github.event.issue.user.login }},检测到您的文件上传失败,请在上传时等待文件前面的 Uploading 消失后再提交! + + - name: Comment for inaccessible snapshot links + if: contains(github.event.issue.body, 'i.gkd.li/snapshot/') == true + uses: actions-cool/issues-helper@v3 + with: + actions: 'create-comment' + token: ${{ secrets.GITHUB_TOKEN }} + issue-number: ${{ github.event.issue.number }} + body: | + 你好 ${{ github.event.issue.user.login }},检测到您提供了他人无法访问的链接,请提供快照页面右上角生成的分享链接!