File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -152,18 +152,26 @@ jobs:
152152 // (don't filter by state to avoid race conditions where GitHub
153153 // hasn't closed the issue yet when this workflow runs)
154154 const errors = [];
155+ const labelsToApply = [];
155156 if (label) {
157+ labelsToApply.push(label);
158+ }
159+ // If the PR has the community-contribution label, propagate it to closing issues
160+ if (context.payload.pull_request.labels.some(l => l.name === 'community-contribution')) {
161+ labelsToApply.push('community-contribution');
162+ }
163+ if (labelsToApply.length > 0) {
156164 for (const issue of closingIssues) {
157- console.log(`Adding label '${label}' to issue #${issue.number}`);
165+ console.log(`Adding labels [${labelsToApply.join(', ')}] to issue #${issue.number}`);
158166 try {
159167 await github.rest.issues.addLabels({
160168 owner,
161169 repo,
162170 issue_number: issue.number,
163- labels: [label]
171+ labels: labelsToApply
164172 });
165173 } catch (error) {
166- errors.push(`Failed to add label to issue #${issue.number}: ${error.message}`);
174+ errors.push(`Failed to add labels to issue #${issue.number}: ${error.message}`);
167175 }
168176 }
169177 }
You can’t perform that action at this time.
0 commit comments