Skip to content

Commit

Permalink
ignoreBot will not ignore dependabot (#93)
Browse files Browse the repository at this point in the history
  • Loading branch information
fuxingloh authored Jul 9, 2021
1 parent 833b598 commit 4fe3f88
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 3 deletions.
11 changes: 11 additions & 0 deletions __tests__/rules/ignore.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,17 @@ describe('sender', () => {
await expectIgnore(false)
})

it('should not ignore Bot dependabot', async () => {
set('issue_comment', 'created', 'Bot', {
sender: {
type: 'Bot',
login: 'dependabot',
id: 100000
}
})
await expectIgnore(false)
})

it('should ignore Bot', async () => {
set('issue_comment', 'created', 'Bot')
await expectIgnore(true)
Expand Down
7 changes: 5 additions & 2 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions src/rules/ignore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ function ignoreLabeledRaceCondition(): boolean {
*/
function ignoreBot(): boolean {
const payload = github.context.payload
if (payload.sender?.login === 'dependabot') {
return false
}
return payload.sender?.type !== 'User'
}

Expand Down

0 comments on commit 4fe3f88

Please sign in to comment.