master
1import { Commit, define, latest } from '#src'
2
3export default define({
4 url: import.meta.url,
5 badges: ['leap-day'] 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() === 1 && data.getDate() === 29) {
13 commits.push(commit)
14 }
15 }
16 }
17
18 if (commits.length > 0) {
19 grant(
20 'leap-day',
21 'Happy February 29th! I committed on a Leap Day!',
22 ).evidenceCommits(...commits.sort(latest).slice(0, 6))
23 }
24 },
25})