master
1import { Commit, define, latest } from '#src'
2
3export default define({
4 url: import.meta.url,
5 badges: ['spooky-commit'] as const,
6 present(data, grant) {
7 const commits: Commit[] = []
8
9 for (const repo of data.repos) {
10 for (const commit of repo.commits) {
11 const data = new Date(commit.committedDate)
12 if (data.getMonth() === 9 && data.getDate() === 31) {
13 commits.push(commit)
14 }
15 }
16 }
17
18 if (commits.length > 0) {
19 grant(
20 'spooky-commit',
21 'I committed on the Halloween! Boo!',
22 ).evidenceCommits(...commits.sort(latest).slice(0, 6))
23 }
24 },
25})