Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix dismissal and references #16

Merged
merged 2 commits into from
Oct 16, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion review.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
const APPROVAL_RE = /(.*) approved these changes/
const REJECTED_RE = /(.*) requested changes/
const DISMISSED_RE = /(.*) dismissed/
const REFERENCE_RE = /referenced this pull request in/
const LOGIN_RE = / .*/

class Metadata {
Expand Down Expand Up @@ -283,6 +284,11 @@

for (const item of items) {
const text = item.innerText

if (text.match(REFERENCE_RE)) {
continue;
}

const approval = text.match(APPROVAL_RE)
if (approval) {
const login = approval[1].toLowerCase()
Expand All @@ -302,7 +308,7 @@
const authors = item.querySelectorAll('a.author');
const authorA = authors.length === 2 ? authors[1] : authors[0];
if (!authorA) continue;
const login = authorA.innerText;
const login = authorA.innerText.toLowerCase();
meta.addDismissal(login)
continue
}
Expand Down