Skip to content
This repository has been archived by the owner on Oct 31, 2022. It is now read-only.

Commit

Permalink
updated ignore rules so that dependabot be ignored (BirthdayResearch#73)
Browse files Browse the repository at this point in the history
* updated ignore rules so that dependabot will not be ignored

* updated build and test
  • Loading branch information
fuxingloh committed Apr 18, 2021
1 parent 7eb256b commit 100ad3b
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 19 deletions.
12 changes: 6 additions & 6 deletions __tests__/rules/ignore.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,9 @@ describe('pull_request', () => {
await expectIgnore(false)
})

it('should not ignore opened if Bot', async () => {
it('should ignore opened if Bot', async () => {
set('pull_request', 'opened', 'Bot')
await expectIgnore(false)
await expectIgnore(true)
})

it('should ignore locked', async () => {
Expand Down Expand Up @@ -264,9 +264,9 @@ describe('pull_request_target', () => {
await expectIgnore(false)
})

it('should not ignore opened if Bot', async () => {
it('should ignore opened if Bot', async () => {
set('pull_request_target', 'opened', 'Bot')
await expectIgnore(false)
await expectIgnore(true)
})

it('should ignore locked', async () => {
Expand Down Expand Up @@ -378,9 +378,9 @@ describe('issues', () => {
await expectIgnore(false)
})

it('should not ignore opened if Bot', async () => {
it('should ignore opened if Bot', async () => {
set('issues', 'opened', 'Bot')
await expectIgnore(false)
await expectIgnore(true)
})

it('should ignore assigned', async () => {
Expand Down
19 changes: 14 additions & 5 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.

24 changes: 17 additions & 7 deletions src/rules/ignore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@ function ignoreClosed(): boolean {
* To prevent mistakes, this will ignore invalid workflow trigger
*/
export default async function (): Promise<boolean> {
if (ignoreLabeledRaceCondition()) {
if (ignoreClosed()) {
return true
}

if (ignoreClosed()) {
if (ignoreLabeledRaceCondition()) {
return true
}

Expand All @@ -103,17 +103,27 @@ export default async function (): Promise<boolean> {
return ignoreBot()
}

if (is('pull_request', ['synchronize', 'opened', 'labeled', 'unlabeled'])) {
if (is('pull_request', ['synchronize', 'opened'])) {
return ignoreBot()
}

if (is('pull_request', ['labeled', 'unlabeled'])) {
return false
}

if (
is('pull_request_target', ['synchronize', 'opened', 'labeled', 'unlabeled'])
) {
if (is('pull_request_target', ['synchronize', 'opened'])) {
return ignoreBot()
}

if (is('pull_request_target', ['labeled', 'unlabeled'])) {
return false
}

if (is('issues', ['opened', 'labeled', 'unlabeled'])) {
if (is('issues', ['opened'])) {
return ignoreBot()
}

if (is('issues', ['labeled', 'unlabeled'])) {
return false
}

Expand Down

0 comments on commit 100ad3b

Please sign in to comment.