Skip to content

Commit

Permalink
Remove deprecated + duplicated event template
Browse files Browse the repository at this point in the history
  • Loading branch information
DEVTomatoCake committed Nov 3, 2023
1 parent aa1a852 commit 780b973
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 99 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,5 @@ All sent data is from the [GitHub webhook documentation](https://docs.github.com
Exceptions:
- `ping` event is not sent
- `registry_package` event has no templates in favor of the `package` event as recommended by GitHub
- `repository_vulnerability_alert` because it is deprecated in favor of `dependabot_alert` as recommended by GitHub
- `team_add` because the `added_to_repository` action from `team` is the same
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ app.get("/login", async (req, res) => {
const body = {
client_id: botId,
client_secret: botSecret,
redirect_uri: "http://localhost:3000/api/oauth", //"https://" + domain + "/api/oauth",
redirect_uri: "https://" + domain + "/dashboard",
grant_type: "authorization_code",
code: req.query.code
}
Expand Down
30 changes: 15 additions & 15 deletions templates/discussion.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module.exports = [
name: "{{ sender.login }}",
icon_url: "{{ sender.avatar_url }}"
},
title: "[{{ repository.name }}:{{ repository.default_branch }}] `discussion` (`answered`)",
title: "[{{ repository.name }}] `discussion` (`answered`)",
url: "{{ repository.html_url }}",
color: color("black")
}]
Expand All @@ -19,7 +19,7 @@ module.exports = [
name: "{{ sender.login }}",
icon_url: "{{ sender.avatar_url }}"
},
title: "[{{ repository.name }}:{{ repository.default_branch }}] `discussion` (`category_changed`)",
title: "[{{ repository.name }}] `discussion` (`category_changed`)",
url: "{{ repository.html_url }}",
color: color("black")
}]
Expand All @@ -30,7 +30,7 @@ module.exports = [
name: "{{ sender.login }}",
icon_url: "{{ sender.avatar_url }}"
},
title: "[{{ repository.name }}:{{ repository.default_branch }}] `discussion` (`closed`)",
title: "[{{ repository.name }}] `discussion` (`closed`)",
url: "{{ repository.html_url }}",
color: color("black")
}]
Expand All @@ -41,7 +41,7 @@ module.exports = [
name: "{{ sender.login }}",
icon_url: "{{ sender.avatar_url }}"
},
title: "[{{ repository.name }}:{{ repository.default_branch }}] `discussion` (`created`)",
title: "[{{ repository.name }}] Discussion **#{{ discussion.number }}** created",
url: "{{ repository.html_url }}",
color: color("green")
}]
Expand All @@ -52,7 +52,7 @@ module.exports = [
name: "{{ sender.login }}",
icon_url: "{{ sender.avatar_url }}"
},
title: "[{{ repository.name }}:{{ repository.default_branch }}] `discussion` (`deleted`)",
title: "[{{ repository.name }}] `discussion` (`deleted`)",
url: "{{ repository.html_url }}",
color: color("red")
}]
Expand All @@ -63,7 +63,7 @@ module.exports = [
name: "{{ sender.login }}",
icon_url: "{{ sender.avatar_url }}"
},
title: "[{{ repository.name }}:{{ repository.default_branch }}] `discussion` (`edited`)",
title: "[{{ repository.name }}] `discussion` (`edited`)",
url: "{{ repository.html_url }}",
color: color("cyan")
}]
Expand All @@ -74,7 +74,7 @@ module.exports = [
name: "{{ sender.login }}",
icon_url: "{{ sender.avatar_url }}"
},
title: "[{{ repository.name }}:{{ repository.default_branch }}] `discussion` (`labeled`)",
title: "[{{ repository.name }}] `discussion` (`labeled`)",
url: "{{ repository.html_url }}",
color: color("cyan")
}]
Expand All @@ -85,7 +85,7 @@ module.exports = [
name: "{{ sender.login }}",
icon_url: "{{ sender.avatar_url }}"
},
title: "[{{ repository.name }}:{{ repository.default_branch }}] `discussion` (`locked`)",
title: "[{{ repository.name }}] `discussion` (`locked`)",
url: "{{ repository.html_url }}",
color: color("gray")
}]
Expand All @@ -96,7 +96,7 @@ module.exports = [
name: "{{ sender.login }}",
icon_url: "{{ sender.avatar_url }}"
},
title: "[{{ repository.name }}:{{ repository.default_branch }}] `discussion` (`pinned`)",
title: "[{{ repository.name }}] `discussion` (`pinned`)",
url: "{{ repository.html_url }}",
color: color("black")
}]
Expand All @@ -107,7 +107,7 @@ module.exports = [
name: "{{ sender.login }}",
icon_url: "{{ sender.avatar_url }}"
},
title: "[{{ repository.name }}:{{ repository.default_branch }}] `discussion` (`reopened`)",
title: "[{{ repository.name }}] `discussion` (`reopened`)",
url: "{{ repository.html_url }}",
color: color("black")
}]
Expand All @@ -118,7 +118,7 @@ module.exports = [
name: "{{ sender.login }}",
icon_url: "{{ sender.avatar_url }}"
},
title: "[{{ repository.name }}:{{ repository.default_branch }}] `discussion` (`transferred`)",
title: "[{{ repository.name }}] `discussion` (`transferred`)",
url: "{{ repository.html_url }}",
color: color("black")
}]
Expand All @@ -129,7 +129,7 @@ module.exports = [
name: "{{ sender.login }}",
icon_url: "{{ sender.avatar_url }}"
},
title: "[{{ repository.name }}:{{ repository.default_branch }}] `discussion` (`unanswered`)",
title: "[{{ repository.name }}] `discussion` (`unanswered`)",
url: "{{ repository.html_url }}",
color: color("black")
}]
Expand All @@ -140,7 +140,7 @@ module.exports = [
name: "{{ sender.login }}",
icon_url: "{{ sender.avatar_url }}"
},
title: "[{{ repository.name }}:{{ repository.default_branch }}] `discussion` (`unlabeled`)",
title: "[{{ repository.name }}] `discussion` (`unlabeled`)",
url: "{{ repository.html_url }}",
color: color("black")
}]
Expand All @@ -151,7 +151,7 @@ module.exports = [
name: "{{ sender.login }}",
icon_url: "{{ sender.avatar_url }}"
},
title: "[{{ repository.name }}:{{ repository.default_branch }}] `discussion` (`unlocked`)",
title: "[{{ repository.name }}] `discussion` (`unlocked`)",
url: "{{ repository.html_url }}",
color: color("black")
}]
Expand All @@ -162,7 +162,7 @@ module.exports = [
name: "{{ sender.login }}",
icon_url: "{{ sender.avatar_url }}"
},
title: "[{{ repository.name }}:{{ repository.default_branch }}] `discussion` (`unpinned`)",
title: "[{{ repository.name }}] `discussion` (`unpinned`)",
url: "{{ repository.html_url }}",
color: color("black")
}]
Expand Down
12 changes: 6 additions & 6 deletions templates/member.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ module.exports = [
name: "{{ sender.login }}",
icon_url: "{{ sender.avatar_url }}"
},
title: "[{{ repository.name }}] Added **{{ member.login }}** as member",
url: "{{ repository.html_url }}",
title: "[{{ repository.name }}] Collaborator **{{ member.login }}** added",
url: "{{ repository.html_url }}/settings/access",
thumbnail: {
url: "{{ member.avatar_url }}"
},
color: color("black")
color: color("white")
}]
},{
action: "edited",
Expand All @@ -23,7 +23,7 @@ module.exports = [
icon_url: "{{ sender.avatar_url }}"
},
title: "[{{ repository.name }}] Edited **{{ member.login }}**'s member permissions",
url: "{{ repository.html_url }}",
url: "{{ repository.html_url }}/settings/access",
thumbnail: {
url: "{{ member.avatar_url }}"
},
Expand All @@ -36,8 +36,8 @@ module.exports = [
name: "{{ sender.login }}",
icon_url: "{{ sender.avatar_url }}"
},
title: "[{{ repository.name }}] Removed **{{ member.login }}** as member",
url: "{{ repository.html_url }}",
title: "[{{ repository.name }}] Collaborator **{{ member.login }}** removed",
url: "{{ repository.html_url }}/settings/access",
thumbnail: {
url: "{{ member.avatar_url }}"
},
Expand Down
3 changes: 1 addition & 2 deletions templates/repository_import.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ module.exports = [
name: "{{ sender.login }}",
icon_url: "{{ sender.avatar_url }}"
},
title: "[{{ repository.full_name }}] Repository imported",
title: "[{{ repository.full_name }}] Repository import {{ status }}",
url: "{{ repository.html_url }}",
description: "Status: {{ status }}",
color: color("darkGreen")
}]
}
Expand Down
49 changes: 0 additions & 49 deletions templates/repository_vulnerability_alert.js

This file was deleted.

18 changes: 9 additions & 9 deletions templates/team.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ module.exports = [
name: "{{ sender.login }}",
icon_url: "{{ sender.avatar_url }}"
},
title: "[{{ repository.name }}:{{ repository.default_branch }}] `team` (`added_to_repository`)",
title: "[{{ repository.name }}] Team **{{ team.name }}** added",
url: "{{ repository.html_url }}",
color: color("black")
color: color("white")
}]
},{
action: "created",
Expand All @@ -19,8 +19,8 @@ module.exports = [
name: "{{ sender.login }}",
icon_url: "{{ sender.avatar_url }}"
},
title: "[{{ repository.name }}:{{ repository.default_branch }}] `team` (`created`)",
url: "{{ repository.html_url }}",
title: "Team **{{ team.name }}** created",
url: "{{ team.html_url }}",
color: color("green")
}]
},{
Expand All @@ -30,8 +30,8 @@ module.exports = [
name: "{{ sender.login }}",
icon_url: "{{ sender.avatar_url }}"
},
title: "[{{ repository.name }}:{{ repository.default_branch }}] `team` (`deleted`)",
url: "{{ repository.html_url }}",
title: "Team **{{ team.name }}** deleted",
url: "{{ team.html_url }}",
color: color("red")
}]
},{
Expand All @@ -41,8 +41,8 @@ module.exports = [
name: "{{ sender.login }}",
icon_url: "{{ sender.avatar_url }}"
},
title: "[{{ repository.name }}:{{ repository.default_branch }}] `team` (`edited`)",
url: "{{ repository.html_url }}",
title: "Team **{{ team.name }}** edited",
url: "{{ team.html_url }}",
color: color("cyan")
}]
},{
Expand All @@ -52,7 +52,7 @@ module.exports = [
name: "{{ sender.login }}",
icon_url: "{{ sender.avatar_url }}"
},
title: "[{{ repository.name }}:{{ repository.default_branch }}] `team` (`removed_from_repository`)",
title: "[{{ repository.name }}] Team **{{ team.name }}** removed",
url: "{{ repository.html_url }}",
color: color("black")
}]
Expand Down
15 changes: 0 additions & 15 deletions templates/team_add.js

This file was deleted.

2 changes: 0 additions & 2 deletions util/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,13 @@ module.exports = {
"repository_dispatch": ["sample.collected"],
"repository_import": [],
"repository_ruleset": ["created", "deleted", "edited"],
"repository_vulnerability_alert": ["create", "dismiss", "reopen", "resolve"],
"secret_scanning_alert": ["created", "reopened", "resolved", "revoked"],
"secret_scanning_alert_location": ["created"],
"security_advisory": ["published", "updated", "withdrawn"],
"security_and_analysis": [],
"sponsorship": ["cancelled", "created", "edited", "pending_cancellation", "pending_tier_change", "tier_changed"],
"star": ["created", "deleted"],
"status": [],
"team_add": [],
"team": ["added_to_repository", "created", "deleted", "edited", "removed_from_repository"],
"watch": ["started"],
"workflow_dispatch": [],
Expand Down

0 comments on commit 780b973

Please sign in to comment.