2022-09-18 12:06:48 +00:00
name : Issue automatic actions
on :
issues :
2022-10-06 10:09:28 +00:00
types : [ opened]
2022-09-18 12:06:48 +00:00
jobs :
issue-moderator :
runs-on : ubuntu-latest
steps :
- name : Generate access token
id : generate_token
uses : tibdex/github-app-token@v1
with :
app_id : ${{ secrets.GH_APP_ID }}
private_key : ${{ secrets.GH_APP_KEY }}
- name : Similarity analysis
uses : actions-cool/issues-similarity-analysis@v1
with :
token : ${{ steps.generate_token.outputs.token }}
2022-10-25 08:41:12 +00:00
filter-threshold : 0.60
2022-09-18 12:06:48 +00:00
title-excludes : ''
comment-title : |
### Your issue looks similar to these issues:
Please close if duplicate.
comment-body : '${index}. ${similarity} #${number}'
- uses : actions/checkout@v2
- 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:
This 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
env :
GH_TEXT : "${{ github.event.issue.title }} ${{ github.event.issue.body }}"
run : |
wget --output-document check_issue.py "https://raw.githubusercontent.com/recloudstream/.github/master/.github/check_issue.py"
pip3 install httpx
RES="$(python3 ./check_issue.py)"
2022-10-26 20:06:19 +00:00
echo "name=${RES}" >> $GITHUB_OUTPUT
2022-09-18 12:06:48 +00:00
- 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 }}`
2023-01-31 09:57:11 +00:00
- name : Label if mentions provider
if : steps.provider_check.outputs.name != 'none'
uses : actions/github-script@v6
with :
github-token : ${{ steps.generate_token.outputs.token }}
script : |
github.rest.issues.addLabels({
issue_number : context.issue.number,
owner : context.repo.owner,
repo : context.repo.repo,
labels : [ "possible provider issue" ]
})
2022-09-18 12:06:48 +00:00
- 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'