We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 87fd55a commit 0f1c322Copy full SHA for 0f1c322
.github/workflows/branch-notification.yml
@@ -24,7 +24,21 @@ jobs:
24
});
25
if (oldBranches.length > 0) {
26
console.log(`Found ${oldBranches.length} branches older than 180 days.`);
27
- // Add notification logic here
+ 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
37
38
+ commit_sha: commits[0].sha,
39
+ body: `This branch is more than 180 days old. Consider deleting or archiving it.`
40
41
+ }
42
} else {
43
console.log('No branches older than 180 days were found.');
44
}
0 commit comments