Skip to content

Commit

Permalink
Finish templates
Browse files Browse the repository at this point in the history
  • Loading branch information
DEVTomatoCake committed Nov 6, 2023
1 parent 02dfe8d commit 14d61be
Show file tree
Hide file tree
Showing 10 changed files with 166 additions and 136 deletions.
2 changes: 1 addition & 1 deletion templates/deployment_protection_rule.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module.exports = [
},
title: "[{{ repository.name }}] Deployment protection rule requested by {{ event }}",
url: "{{ repository.html_url }}",
color: color("black")
color: color("gray")
}]
}
]
106 changes: 61 additions & 45 deletions templates/issues.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ module.exports = [
icon_url: "{{ sender.avatar_url }}",
url: "{{ sender.html_url }}"
},
title: "[{{ repository.name }}] `issues` (`assigned`)",
url: "{{ repository.html_url }}",
color: color("black")
title: "[{{ repository.name }}] Issue **#{{ issue.number }}** assigned to **{{ assignee.login }}**",
url: "{{ issue.html_url }}",
description: "{{ issue.title }}",
color: color("cyan")
}]
},{
action: "closed",
Expand All @@ -21,9 +22,10 @@ module.exports = [
icon_url: "{{ sender.avatar_url }}",
url: "{{ sender.html_url }}"
},
title: "[{{ repository.name }}] `issues` (`closed`)",
url: "{{ repository.html_url }}",
color: color("black")
title: "[{{ repository.name }}] Issue **#{{ issue.number }}** closed",
url: "{{ issue.html_url }}",
description: "{{ issue.title }}",
color: color("green")
}]
},{
action: "deleted",
Expand All @@ -33,8 +35,9 @@ module.exports = [
icon_url: "{{ sender.avatar_url }}",
url: "{{ sender.html_url }}"
},
title: "[{{ repository.name }}] `issues` (`deleted`)",
url: "{{ repository.html_url }}",
title: "[{{ repository.name }}] Issue **#{{ issue.number }}** deleted",
url: "{{ issue.html_url }}",
description: "{{ issue.title }}",
color: color("red")
}]
},{
Expand All @@ -45,9 +48,10 @@ module.exports = [
icon_url: "{{ sender.avatar_url }}",
url: "{{ sender.html_url }}"
},
title: "[{{ repository.name }}] `issues` (`demilestoned`)",
url: "{{ repository.html_url }}",
color: color("black")
title: "[{{ repository.name }}] Issue **#{{ issue.number }}** removed from milestone **{{ milestone.title }}**",
url: "{{ issue.html_url }}",
description: "{{ issue.title }}",
color: color("cyan")
}]
},{
action: "edited",
Expand All @@ -57,8 +61,9 @@ module.exports = [
icon_url: "{{ sender.avatar_url }}",
url: "{{ sender.html_url }}"
},
title: "[{{ repository.name }}] `issues` (`edited`)",
url: "{{ repository.html_url }}",
title: "[{{ repository.name }}] Issue **#{{ issue.number }}** edited",
url: "{{ issue.html_url }}",
description: "{{ issue.title }}",
color: color("cyan")
}]
},{
Expand All @@ -69,8 +74,9 @@ module.exports = [
icon_url: "{{ sender.avatar_url }}",
url: "{{ sender.html_url }}"
},
title: "[{{ repository.name }}] `issues` (`labeled`)",
url: "{{ repository.html_url }}",
title: "[{{ repository.name }}] Label {{ label.name }} added to issue **#{{ issue.number }}**",
url: "{{ issue.html_url }}",
description: "{{ issue.title }}",
color: color("cyan")
}]
},{
Expand All @@ -81,9 +87,10 @@ module.exports = [
icon_url: "{{ sender.avatar_url }}",
url: "{{ sender.html_url }}"
},
title: "[{{ repository.name }}] `issues` (`locked`)",
url: "{{ repository.html_url }}",
color: color("gray")
title: "[{{ repository.name }}] Issue **#{{ issue.number }}** locked",
url: "{{ issue.html_url }}",
description: "{{ issue.title }}",
color: color("magenta")
}]
},{
action: "milestoned",
Expand All @@ -93,9 +100,10 @@ module.exports = [
icon_url: "{{ sender.avatar_url }}",
url: "{{ sender.html_url }}"
},
title: "[{{ repository.name }}] `issues` (`milestoned`)",
url: "{{ repository.html_url }}",
color: color("black")
title: "[{{ repository.name }}] Issue **#{{ issue.number }}** added to milestone **{{ milestone.title }}**",
url: "{{ issue.html_url }}",
description: "{{ issue.title }}",
color: color("cyan")
}]
},{
action: "opened",
Expand All @@ -105,9 +113,10 @@ module.exports = [
icon_url: "{{ sender.avatar_url }}",
url: "{{ sender.html_url }}"
},
title: "[{{ repository.name }}] `issues` (`opened`)",
url: "{{ repository.html_url }}",
color: color("black")
title: "[{{ repository.name }}] Issue **#{{ issue.number }}** opened",
url: "{{ issue.html_url }}",
description: "{{ issue.title }}",
color: color("blue")
}]
},{
action: "pinned",
Expand All @@ -117,9 +126,10 @@ module.exports = [
icon_url: "{{ sender.avatar_url }}",
url: "{{ sender.html_url }}"
},
title: "[{{ repository.name }}] `issues` (`pinned`)",
url: "{{ repository.html_url }}",
color: color("black")
title: "[{{ repository.name }}] Issue **#{{ issue.number }}** pinned",
url: "{{ issue.html_url }}",
description: "{{ issue.title }}",
color: color("magenta")
}]
},{
action: "reopened",
Expand All @@ -129,9 +139,10 @@ module.exports = [
icon_url: "{{ sender.avatar_url }}",
url: "{{ sender.html_url }}"
},
title: "[{{ repository.name }}] `issues` (`reopened`)",
url: "{{ repository.html_url }}",
color: color("black")
title: "[{{ repository.name }}] Issue **#{{ issue.number }}** reopened",
url: "{{ issue.html_url }}",
description: "{{ issue.title }}",
color: color("red")
}]
},{
action: "transferred",
Expand All @@ -141,9 +152,10 @@ module.exports = [
icon_url: "{{ sender.avatar_url }}",
url: "{{ sender.html_url }}"
},
title: "[{{ repository.name }}] `issues` (`transferred`)",
url: "{{ repository.html_url }}",
color: color("black")
title: "[{{ repository.name }}] Issue **#{{ issue.number }}** transferred",
url: "{{ issue.html_url }}",
description: "{{ issue.title }}",
color: color("gray")
}]
},{
action: "unassigned",
Expand All @@ -153,9 +165,10 @@ module.exports = [
icon_url: "{{ sender.avatar_url }}",
url: "{{ sender.html_url }}"
},
title: "[{{ repository.name }}] `issues` (`unassigned`)",
url: "{{ repository.html_url }}",
color: color("black")
title: "[{{ repository.name }}] Assignee removed from issue **#{{ issue.number }}**",
url: "{{ issue.html_url }}",
description: "{{ issue.title }}",
color: color("cyan")
}]
},{
action: "unlabeled",
Expand All @@ -165,9 +178,10 @@ module.exports = [
icon_url: "{{ sender.avatar_url }}",
url: "{{ sender.html_url }}"
},
title: "[{{ repository.name }}] `issues` (`unlabeled`)",
url: "{{ repository.html_url }}",
color: color("black")
title: "[{{ repository.name }}] Label {{ label.name }} removed from issue **#{{ issue.number }}**",
url: "{{ issue.html_url }}",
description: "{{ issue.title }}",
color: color("cyan")
}]
},{
action: "unlocked",
Expand All @@ -177,9 +191,10 @@ module.exports = [
icon_url: "{{ sender.avatar_url }}",
url: "{{ sender.html_url }}"
},
title: "[{{ repository.name }}] `issues` (`unlocked`)",
url: "{{ repository.html_url }}",
color: color("black")
title: "[{{ repository.name }}] Issue **#{{ issue.number }}** unlocked",
url: "{{ issue.html_url }}",
description: "{{ issue.title }}",
color: color("magenta")
}]
},{
action: "unpinned",
Expand All @@ -189,9 +204,10 @@ module.exports = [
icon_url: "{{ sender.avatar_url }}",
url: "{{ sender.html_url }}"
},
title: "[{{ repository.name }}] `issues` (`unpinned`)",
url: "{{ repository.html_url }}",
color: color("black")
title: "[{{ repository.name }}] Issue **#{{ issue.number }}** unpinned",
url: "{{ issue.html_url }}",
description: "{{ issue.title }}",
color: color("magenta")
}]
}
]
2 changes: 1 addition & 1 deletion templates/member.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ module.exports = [
thumbnail: {
url: "{{ member.avatar_url }}"
},
color: color("black")
color: color("red")
}]
}
]
8 changes: 4 additions & 4 deletions templates/organization.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ module.exports = [
},
title: "[{{ organization.name }}] **{{ member.user.login }}** added to organization",
url: "{{ organization.html_url }}",
color: color("black")
color: color("green")
}]
},{
action: "member_invited",
Expand All @@ -34,7 +34,7 @@ module.exports = [
},
title: "[{{ organization.name }}] **{{ invitation.login || invitation.email }}** invited to organization",
url: "{{ organization.html_url }}",
color: color("black")
color: color("gray")
}]
},{
action: "member_removed",
Expand All @@ -46,7 +46,7 @@ module.exports = [
},
title: "[{{ organization.name }}] **{{ member.user.login }}** removed from organization",
url: "{{ organization.html_url }}",
color: color("black")
color: color("red")
}]
},{
action: "renamed",
Expand All @@ -58,7 +58,7 @@ module.exports = [
},
title: "Organization renamed from **{{ changes.login.from }}** to **{{ organization.name }}**",
url: "{{ organization.html_url }}",
color: color("black")
color: color("cyan")
}]
}
]
2 changes: 1 addition & 1 deletion templates/page_build.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module.exports = [
},
title: "[{{ repository.name }}] Page build {{ build.status }}",
url: "{{ build.url }}",
color: color("black")
color: color("magenta")
}]
}
]
31 changes: 12 additions & 19 deletions templates/projects_v2_item.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const color = require("../util/color.js")

module.exports = [
module.exports = [ // TODO: Fetch project name & item data from GitHub using projects_v2_item.project_node_id / projects_v2_item.content_node_id

Check failure on line 3 in templates/projects_v2_item.js

View workflow job for this annotation

GitHub Actions / Codestandards

Unexpected 'todo' comment: 'TODO: Fetch project name & item data...'
{
action: "archived",
embeds: [{
Expand All @@ -9,9 +9,8 @@ module.exports = [
icon_url: "{{ sender.avatar_url }}",
url: "{{ sender.html_url }}"
},
title: "[{{ repository.name }}] `projects_v2_item` (`archived`)",
url: "{{ repository.html_url }}",
color: color("black")
title: "Project item archived",
color: color("gray")
}]
},{
action: "converted",
Expand All @@ -21,9 +20,8 @@ module.exports = [
icon_url: "{{ sender.avatar_url }}",
url: "{{ sender.html_url }}"
},
title: "[{{ repository.name }}] `projects_v2_item` (`converted`)",
url: "{{ repository.html_url }}",
color: color("black")
title: "Project item converted",
color: color("green")
}]
},{
action: "created",
Expand All @@ -33,8 +31,7 @@ module.exports = [
icon_url: "{{ sender.avatar_url }}",
url: "{{ sender.html_url }}"
},
title: "[{{ repository.name }}] `projects_v2_item` (`created`)",
url: "{{ repository.html_url }}",
title: "Project item created",
color: color("green")
}]
},{
Expand All @@ -45,8 +42,7 @@ module.exports = [
icon_url: "{{ sender.avatar_url }}",
url: "{{ sender.html_url }}"
},
title: "[{{ repository.name }}] `projects_v2_item` (`deleted`)",
url: "{{ repository.html_url }}",
title: "Project item deleted",
color: color("red")
}]
},{
Expand All @@ -57,8 +53,7 @@ module.exports = [
icon_url: "{{ sender.avatar_url }}",
url: "{{ sender.html_url }}"
},
title: "[{{ repository.name }}] `projects_v2_item` (`edited`)",
url: "{{ repository.html_url }}",
title: "Project item edited",
color: color("cyan")
}]
},{
Expand All @@ -69,9 +64,8 @@ module.exports = [
icon_url: "{{ sender.avatar_url }}",
url: "{{ sender.html_url }}"
},
title: "[{{ repository.name }}] `projects_v2_item` (`reordered`)",
url: "{{ repository.html_url }}",
color: color("black")
title: "Project item reordered",
color: color("cyan")
}]
},{
action: "restored",
Expand All @@ -81,9 +75,8 @@ module.exports = [
icon_url: "{{ sender.avatar_url }}",
url: "{{ sender.html_url }}"
},
title: "[{{ repository.name }}] `projects_v2_item` (`restored`)",
url: "{{ repository.html_url }}",
color: color("black")
title: "Project item restored",
color: color("magenta")
}]
}
]
Loading

0 comments on commit 14d61be

Please sign in to comment.