File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments