Skip to content

Commit 84a92aa

Browse files
committed
Update the comment on successful resolution of headers.
Signed-off-by: David Venable <dlv@amazon.com>
1 parent fb5a23f commit 84a92aa

1 file changed

Lines changed: 32 additions & 1 deletion

File tree

.github/workflows/license-header-check.yml

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,4 +83,35 @@ jobs:
8383
});
8484
}
8585
env:
86-
VIOLATIONS: ${{ steps.license-check.outputs.violations }}
86+
VIOLATIONS: ${{ steps.license-check.outputs.violations }}
87+
88+
- name: Update PR comment (all violations resolved)
89+
if: success()
90+
uses: actions/github-script@v8
91+
with:
92+
script: |
93+
const { data: comments } = await github.rest.issues.listComments({
94+
owner: context.repo.owner,
95+
repo: context.repo.repo,
96+
issue_number: context.issue.number,
97+
});
98+
99+
const botComment = comments.find(comment =>
100+
comment.user.type === 'Bot' &&
101+
(comment.body.includes('License Header Violations Found') || comment.body.includes('License Header Check Passed'))
102+
);
103+
104+
if (botComment) {
105+
const successBody = [
106+
'## ✅ License Header Check Passed',
107+
'',
108+
'All newly added files have proper license headers. Great work! 🎉'
109+
].join('\n');
110+
111+
await github.rest.issues.updateComment({
112+
owner: context.repo.owner,
113+
repo: context.repo.repo,
114+
comment_id: botComment.id,
115+
body: successBody
116+
});
117+
}

0 commit comments

Comments
 (0)