mirror of
https://github.com/nickzuber/meteorite.git
synced 2024-11-28 23:03:35 +03:00
dont break on ci alerts
This commit is contained in:
parent
32d7c35f57
commit
f87f33b591
@ -3,7 +3,7 @@
|
||||
"version": "1.0.0",
|
||||
"private": true,
|
||||
"engines": {
|
||||
"node": "12.x"
|
||||
"node": "16.x"
|
||||
},
|
||||
"dependencies": {
|
||||
"@emotion/core": "^10.0.10",
|
||||
|
@ -8,10 +8,14 @@ const BASE_GITHUB_API_URL = 'https://api.github.com';
|
||||
const PER_PAGE = 50;
|
||||
|
||||
function transformUrlFromResponse(url) {
|
||||
try {
|
||||
return url
|
||||
.replace('api.github.com', 'github.com')
|
||||
.replace('/repos/', '/')
|
||||
.replace('/pulls/', '/pull/');
|
||||
} catch (err) {
|
||||
return url || ""
|
||||
}
|
||||
}
|
||||
|
||||
function processHeadersAndBodyJson(response) {
|
||||
@ -171,10 +175,7 @@ class NotificationsProvider extends React.Component {
|
||||
//
|
||||
// 1 month is pretty arbitrary, we can raise this if we want.
|
||||
const since =
|
||||
moment()
|
||||
.subtract(1, 'month')
|
||||
.toISOString()
|
||||
.split('.')[0] + 'Z';
|
||||
moment().subtract(1, 'month').toISOString().split('.')[0] + 'Z';
|
||||
|
||||
const headers = {
|
||||
Authorization: `token ${this.props.token}`,
|
||||
@ -209,7 +210,33 @@ class NotificationsProvider extends React.Component {
|
||||
if (links && links.next && links.next.page) {
|
||||
nextPage = links.next.page;
|
||||
}
|
||||
return this.processNotificationsChunk(nextPage, json);
|
||||
|
||||
const chunk = json.filter(notification => {
|
||||
// 2/4/2023
|
||||
// New reasons have joined the party.
|
||||
// Restrict some reasons to maintain backwards compat.
|
||||
const allowedReasons = [
|
||||
"assign",
|
||||
"author",
|
||||
"comment",
|
||||
// "ci_activity",
|
||||
// "invitation",
|
||||
// "manual",
|
||||
"mention",
|
||||
"review_requested",
|
||||
// "security_alert",
|
||||
"state_change",
|
||||
"subscribed",
|
||||
"team_mention"
|
||||
]
|
||||
if (allowedReasons.includes(notification.reason)) {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
|
||||
return this.processNotificationsChunk(nextPage, chunk);
|
||||
});
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user