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

0f5f8e163d15d04244164eb877e611959e84fec3

Wolfsblvt <wolfsblvt@gmail.com>

1 files changed, +8 -25Ignore whitespace
.github/workflows/on-open-handler.yml+8 -25
@@ -10,32 +10,15 @@ jobs:
10 label-maintainer:10 label-maintainer:
11 name: Label if Author is a Repo Maintainer11 name: Label if Author is a Repo Maintainer
12 runs-on: ubuntu-latest12 runs-on: ubuntu-latest
13 if: contains(fromJson('["Cohee1207", "RossAscends", "Wolfsblvt"]'), github.actor)
1314
14 steps:15 steps:
15 - name: Label if Author is a Repo Maintainer16 - name: Label if Author is a Repo Maintainer
16 # GitHub Script17 # 🤖 Issues Helper
17 # https://github.com/marketplace/actions/github-script18 # https://github.com/marketplace/actions/issues-helper
18 uses: actions/github-script@v719 uses: actions-cool/issues-helper@v3
19 with:20 with:
20 script: |21 actions: 'add-labels'
21 // Hard-coded list of maintainer usernames22 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 }}
2324 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 }