|
79 | 79 |
|
80 | 80 | const maintainers = process.env.MAINTAINERS ? process.env.MAINTAINERS.split(',').map(m => m.trim()) : []; |
81 | 81 |
|
| 82 | + const { data: issue } = await github.rest.issues.get({ |
| 83 | + owner: context.repo.owner, |
| 84 | + repo: context.repo.repo, |
| 85 | + issue_number: issueNumber, |
| 86 | + }); |
| 87 | + const reporter = issue.user.login; |
| 88 | +
|
82 | 89 | // First, check if it's tracked by a parent issue or part of a project |
83 | 90 | const query = ` |
84 | 91 | query($owner: String!, $repo: String!, $issueNumber: Int!) { |
@@ -115,20 +122,32 @@ jobs: |
115 | 122 | } catch (e) { |
116 | 123 | // Ignore if label doesn't exist |
117 | 124 | } |
| 125 | +
|
| 126 | + const assignees = issue.assignees.map(a => a.login); |
| 127 | + const hasAssignees = assignees.length > 0; |
| 128 | + |
| 129 | + const isFeatureRequest = issue.labels.some(l => { |
| 130 | + const name = typeof l === 'string' ? l : l.name; |
| 131 | + const lowerName = name.toLowerCase(); |
| 132 | + return lowerName.includes('feature') || lowerName.includes('enhancement'); |
| 133 | + }); |
| 134 | +
|
| 135 | + if (isFeatureRequest && !hasAssignees) { |
| 136 | + await github.rest.issues.createComment({ |
| 137 | + owner: context.repo.owner, |
| 138 | + repo: context.repo.repo, |
| 139 | + issue_number: issueNumber, |
| 140 | + body: `@${reporter}, this feature request is currently tracked by an epic or project but has no assignees. Could you please let us know if this is still needed?` |
| 141 | + }); |
| 142 | + } |
| 143 | +
|
118 | 144 | core.setOutput('is_stale', 'true'); |
119 | 145 | return; |
120 | 146 | } |
121 | 147 | } catch (err) { |
122 | 148 | console.log('Failed to fetch GraphQL data for parent issues/projects:', err.message); |
123 | 149 | } |
124 | 150 |
|
125 | | - const { data: issue } = await github.rest.issues.get({ |
126 | | - owner: context.repo.owner, |
127 | | - repo: context.repo.repo, |
128 | | - issue_number: issueNumber, |
129 | | - }); |
130 | | - const reporter = issue.user.login; |
131 | | -
|
132 | 151 | const { data: comments } = await github.rest.issues.listComments({ |
133 | 152 | owner: context.repo.owner, |
134 | 153 | repo: context.repo.repo, |
|
0 commit comments