mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-02 18:18:06 +08:00
fix: add whitelisted user
these user will auto pass route test
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
const noFound = 'Auto: Route No Found';
|
||||
const whiteListedUser = ['dependabot-preview[bot]'];
|
||||
|
||||
module.exports = async ({ github, context, core }, body, number) => {
|
||||
core.debug(`sender: ${context.payload.sender.login}`);
|
||||
@@ -18,12 +19,28 @@ module.exports = async ({ github, context, core }, body, number) => {
|
||||
.catch((e) => {
|
||||
core.warning(e);
|
||||
});
|
||||
|
||||
if (whiteListedUser.includes(context.payload.sender.login)) {
|
||||
core.info('PR created by a whitelisted user, passing');
|
||||
await removeLabel();
|
||||
await github.issues
|
||||
.addLabels({
|
||||
issue_number: number,
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
labels: ['Auto: whitelisted'],
|
||||
})
|
||||
.catch((e) => {
|
||||
core.warning(e);
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (m && m[1]) {
|
||||
res = m[1].trim().split('\r\n');
|
||||
core.info(`routes detected: ${res}`);
|
||||
|
||||
if ((res.length > 0 && res[0] === 'NOROUTE') || context.payload.sender.login === 'dependabot-preview[bot]') {
|
||||
if ((res.length > 0 && res[0] === 'NOROUTE')) {
|
||||
core.info('PR stated no route, passing');
|
||||
await removeLabel();
|
||||
await github.issues
|
||||
|
||||
Reference in New Issue
Block a user