Commit 4f34060

Anton Medvedev <anton@medv.io>
2023-10-06 09:03:05
Add yeti badge
1 parent 4647571
Changed files (3)
src/all-badges/yeti/yeti.png
Binary file
src/all-badges/yeti/yeti.ts
@@ -0,0 +1,19 @@
+import {BadgePresenter, Present} from '../../badges.js'
+
+export default new class implements BadgePresenter {
+  url = new URL(import.meta.url)
+  badges = [
+    'yeti',
+  ] as const
+  present: Present = (data, grant) => {
+    for (const repo of data.repos) {
+      for (const commit of repo.commits) {
+        if (/yeti/i.test(commit.message)) {
+          grant('yeti', 'I found the yeti!')
+            .evidenceCommits(commit)
+          return
+        }
+      }
+    }
+  }
+}
src/all-badges/index.ts
@@ -5,4 +5,5 @@ export const allBadges = [
   await import('./fuck-commit/fuck-commit.js'),
   await import('./mass-delete-commit/mass-delete-commit.js'),
   await import('./revert-revert-commit/revert-revert-commit.js'),
+  await import('./yeti/yeti.js'),
 ] as const