|
1 | 1 | name: Dependabot Upgrade Monitor |
2 | 2 |
|
3 | 3 | on: |
| 4 | + # Use the `pull_request` event to trigger the workflow when a PR is opened or updated. |
| 5 | + # If we use `pull_request_target`, workflows from forked PRs won't run properly |
| 6 | + # and we cannot use the default GITHUB_TOKEN securely. |
4 | 7 | pull_request: |
5 | 8 | types: [opened, synchronize] |
6 | 9 |
|
@@ -81,30 +84,10 @@ jobs: |
81 | 84 | uses: actions/github-script@v7 |
82 | 85 | with: |
83 | 86 | script: | |
84 | | - // Step 1: Get collaborators |
85 | | - const collaborators = await github.paginate( |
86 | | - github.rest.repos.listCollaborators, |
87 | | - { |
88 | | - owner: context.repo.owner, |
89 | | - repo: context.repo.repo, |
90 | | - affiliation: 'direct', |
91 | | - per_page: 100 |
92 | | - } |
93 | | - ); |
94 | | -
|
95 | | - // Step 2: Filter maintainers |
96 | | - const maintainers = collaborators |
97 | | - .filter(user => user.permissions.admin) |
98 | | - .map(user => user.login); |
99 | | -
|
100 | | - // Step 3: Assign to the PR |
101 | | - if (maintainers.length > 0) { |
102 | | - await github.rest.issues.addAssignees({ |
103 | | - owner: context.repo.owner, |
104 | | - repo: context.repo.repo, |
105 | | - issue_number: context.issue.number, |
106 | | - assignees: maintainers, |
107 | | - }); |
108 | | - } else { |
109 | | - console.warn("No maintainers found to assign."); |
110 | | - } |
| 87 | + const maintainers = ["dentiny"]; |
| 88 | + await github.rest.issues.addAssignees({ |
| 89 | + owner: context.repo.owner, |
| 90 | + repo: context.repo.repo, |
| 91 | + issue_number: context.issue.number, |
| 92 | + assignees: maintainers, |
| 93 | + }); |
0 commit comments