File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed
Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change 77
88permissions :
99 pull-requests : write
10+ contents : read
1011
1112jobs :
1213 thank-you :
1314 # Only run if the PR was actually merged
1415 if : github.event.pull_request.merged
1516 runs-on : ubuntu-latest
1617 steps :
18+ # We must check out the code to read the MAINTAINERS.json file
19+ - name : Checkout repository
20+ uses : actions/checkout@v4
21+
1722 - name : Leave a Thank You Comment
1823 uses : actions/github-script@v7
1924 with :
2025 script : |
26+ const fs = require('fs');
2127 const creator = context.payload.pull_request.user.login;
22- const association = context.payload.pull_request.author_association;
2328
2429 // Skip bots to avoid comment loops
2530 if (creator.endsWith('[bot]')) {
2631 console.log('Skipping bot account.');
2732 return;
2833 }
2934
35+ // Read maintainers list from JSON file
36+ const maintainersData = JSON.parse(fs.readFileSync('MAINTAINERS.json', 'utf8'));
37+ const maintainers = maintainersData.maintainers.map(m => m.toLowerCase());
38+
3039 // Skip core maintainers to avoid spamming the team
31- const ignoreAssociations = ['MEMBER', 'OWNER', 'COLLABORATOR'];
32- if (ignoreAssociations.includes(association)) {
33- console.log(`Skipping maintainer account (Association: ${association}).`);
40+ if (maintainers.includes(creator.toLowerCase())) {
41+ console.log(`Skipping maintainer account: ${creator}`);
3442 return;
3543 }
3644
You can’t perform that action at this time.
0 commit comments