Skip to content

Commit

Permalink
Fix blacklist (#457)
Browse files Browse the repository at this point in the history
* Fix comment package name

* Fix blacklist check
  • Loading branch information
Howard20181 authored Jul 5, 2023
1 parent f4aa01d commit 038f2d0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion bot.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function checkPackageName (packageName) {
if (!group.match(/^[a-zA-Z_][a-zA-Z_0-9]*$/) || group.toLowerCase() === 'example') return false
}
blacklist = ['com.android', 'com.google', 'org.lsposed', 'io.github.lsposed'];
for (const item in blacklist) {
for (const item of blacklist) {
if(packageName.toLowerCase().startsWith(item)) return false
}
return true
Expand Down
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ async function run () {
}
if (label === 'invalid') {
await leaveComment(token, owner, repo, issue.number,
'It seems like your request has an invalid package name, please consider another package name. (e.g. `io.github.' + owner + '.[appname]`)' +
'It seems like your request has an invalid package name, please consider another package name. (e.g. `io.github.' + issue.user.login + '.[appname]`)' +
"If that's not true, please contact a human by " +
'https://modules.lsposed.org/submission?type=appeal'
)
Expand Down Expand Up @@ -42,7 +42,7 @@ async function run () {
await closeIssue(token, owner, repo, issue.number)
} else {
await leaveComment(token, owner, repo, issue.number,
'It seems like your package name is already in use, please consider another package name. (e.g. `io.github.' + owner + '.' + title.split('.').slice(-1) + '`)' +
'It seems like your package name is already in use, please consider another package name. (e.g. `io.github.' + issue.user.login + '.' + title.split('.').slice(-1) + '`)' +
"If you believe that's a fraudulent use, please contact a human by " +
'https://modules.lsposed.org/submission?type=appeal'
)
Expand Down

0 comments on commit 038f2d0

Please sign in to comment.