diff --git a/.github/workflows/issue-action.yml b/.github/workflows/issue-action.yml index b59b83bc..3f680fb3 100644 --- a/.github/workflows/issue-action.yml +++ b/.github/workflows/issue-action.yml @@ -22,17 +22,36 @@ jobs: title-excludes: '' comment-title: '### Your issue looks similar to these issues:.\n\nPlease close if duplicate.' comment-body: '${index}. ${similarity} #${number}' + - name: Automatically close issues that dont follow the issue template + uses: lucasbento/auto-close-issues@v1.0.2 + with: + github-token: ${{ steps.generate_token.outputs.token }} + issue-close-message: "@${issue.user.login}: hello! :wave:\n\nThis issue is being automatically closed because it does not follow the issue template." + closed-issues-label: "invalid" + - name: Check if issue mentions a provider + id: provider_check + run: | + wget --output-document check_issue.py "https://raw.githubusercontent.com/recloudstream/.github/master/.github/check_issue.py" + pip3 install httpx + export GH_TEXT="${{ github.event.issue.title }} ${{ github.event.issue.body }}" + RES="$(python3 ./check_issue.py)" + echo "::set-output name=name::${RES + - name: Comment if issue mentions a provider + if: ${{ steps.provider_check.outputs.name != "none" }} + uses: actions-cool/issues-helper@v3 + with: + actions: 'create-comment' + token: ${{ steps.generate_token.outputs.token }} + body: | + Hello ${{ github.event.issue.user.login }}. + Please do not report any provider bugs here. This repository does not contain any providers. Please find the appropriate repository and report your issue there or join the [discord](https://discord.gg/5Hus6fM). + + Found provider name: `${{ steps.provider_check.outputs.name }}` - name: Add eyes reaction to all issues uses: actions-cool/emoji-helper@v1.0.0 with: type: 'issue' token: ${{ steps.generate_token.outputs.token }} emoji: 'eyes' - - name: Automatically close issues that dont follow the issue template - uses: lucasbento/auto-close-issues@v1.0.2 - with: - github-token: ${{ steps.generate_token.outputs.token }} - issue-close-message: "@${issue.user.login}: hello! :wave:\n\nThis issue is being automatically closed because it does not follow the issue template." - losed-issues-label: "invalid"