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
2024-01-03 09:24:28 +00:00
uses : tibdex/github-app-token@v2
2022-09-18 12:06:48 +00:00
with :
app_id : ${{ secrets.GH_APP_ID }}
private_key : ${{ secrets.GH_APP_KEY }}
- name : Similarity analysis
2023-02-07 10:15:00 +00:00
id : similarity
2022-09-18 12:06:48 +00:00
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}'
2023-02-07 10:15:00 +00:00
- name : Label if possible duplicate
if : steps.similarity.outputs.similar-issues-found =='true'
2024-01-03 09:24:28 +00:00
uses : actions/github-script@v7
2023-02-07 10:15:00 +00:00
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 duplicate" ]
})
2024-01-03 09:24:28 +00:00
- uses : actions/checkout@v4
2022-09-18 12:06:48 +00:00
- 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'
2024-01-03 09:24:28 +00:00
uses : actions/github-script@v7
2023-01-31 09:57:11 +00:00
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'