Merge branch 'staging' into feat-add-regex-toggle-command

0f5f8e163d15d04244164eb877e611959e84fec3

Wolfsblvt <wolfsblvt@gmail.com>

1 files changed, +8 -25Showing whitespace changes
.github/workflows/on-open-handler.yml+8 -25
@@ -10,32 +10,15 @@ jobs:
1010 label-maintainer:
1111 name: Label if Author is a Repo Maintainer
1212 runs-on: ubuntu-latest
13+ if: contains(fromJson('["Cohee1207", "RossAscends", "Wolfsblvt"]'), github.actor)
1314
1415 steps:
1516 - name: Label if Author is a Repo Maintainer
1617 # GitHub🤖 ScriptIssues Helper
1718 # https://github.com/marketplace/actions/githubissues-scripthelper
1819 uses: actions-cool/githubissues-scripthelper@v7v3
1920 with:
20- script: |
21+ actions: 'add-labels'
21- // Hard-coded list of maintainer usernames
22+ token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
22- const maintainers = ['Cohee1207', 'RossAscends', 'Wolfsblvt'];
23+ issue-number: ${{ github.event.issue.number || github.event.pull_request.number }}
23-
24+ labels: '👷 Maintainer'
24- // Get event details (works for issues and pull requests)
25- const { owner, repo } = context.repo;
26- const payload = context.payload;
27- const eventData = payload.issue || payload.pull_request;
28- const username = eventData.user.login;
29- const issue_number = eventData.number;
30-
31- if (maintainers.includes(username)) {
32- console.log(`User ${username} is a maintainer. Adding "Maintainer" label to issue/PR #${issue_number}`);
33- await github.issues.addLabels({
34- owner,
35- repo,
36- issue_number,
37- labels: ['👷 Maintainer'],
38- });
39- } else {
40- console.log(`User ${username} is not on the maintainer list.`);
41- }