File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change 24
24
});
25
25
if (oldBranches.length > 0) {
26
26
console.log(`Found ${oldBranches.length} branches older than 180 days.`);
27
- // Add notification logic here
27
+ for (const branch of oldBranches) {
28
+ const { data: commits } = await github.repos.listCommits({
29
+ owner: context.repo.owner,
30
+ repo: context.repo.repo,
31
+ sha: branch.name,
32
+ per_page: 1,
33
+ });
34
+ const commitAuthorEmail = commits[0].commit.author.email;
35
+ await github.repos.createCommitComment({
36
+ owner: context.repo.owner,
37
+ repo: context.repo.repo,
38
+ commit_sha: commits[0].sha,
39
+ body: `This branch is more than 180 days old. Consider deleting or archiving it.`
40
+ });
41
+ }
28
42
} else {
29
43
console.log('No branches older than 180 days were found.');
30
44
}
You can’t perform that action at this time.
0 commit comments