-
Notifications
You must be signed in to change notification settings - Fork 5.6k
32 lines (28 loc) · 1.01 KB
/
label_ad_issue.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
name: label_ad_issue
on:
issues:
types:
- opened
jobs:
label_ad_issue:
runs-on: ubuntu-latest
environment: Scheduled GITHUB_OWNER publish
steps:
- env:
GH_TOKEN: ${{ secrets.GITHUB_OWNER_TOKEN }}
ISSUE_URL: ${{ github.event.issue.html_url }}
ISSUE_TITLE: ${{ github.event.issue.title }}
run: |
stat=no
AD_KEYWORDS=(download crack "serial key" "license key" "product key" "free download" "full version" "full crack" "full keygen" "full license" "full activation" "full serial")
ISSUE_TITLE_LOWER=$(echo $ISSUE_TITLE | tr '[:upper:]' '[:lower:]')
for KEYWORD in ${AD_KEYWORDS[@]}; do
if [[ $ISSUE_TITLE_LOWER == *$KEYWORD* ]] && [[ $ISSUE_TITLE_LOWER != *input* ]]; then
stat=yes
break
fi
done
if [[ $stat == yes ]]; then
echo "Issue title contains advertisement keywords."
gh issue delete $ISSUE_URL --yes
fi