master
 1import { Commit, define } from '#src'
 2
 3export default define({
 4  url: import.meta.url,
 5  badges: ['bad-words'] 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        if (/fuck/i.test(commit.message + commit.messageBody)) {
12          commits.push(commit)
13        }
14      }
15    }
16
17    if (commits.length > 0) {
18      grant(
19        'bad-words',
20        'I used a word "fuck" in my commit message.',
21      ).evidenceCommitsWithMessage(...commits)
22    }
23  },
24})