Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

Update remove-labels-and-assignees-on-close.yml

peaklabs-dev60e9fcc202d2
diff --git a/.github/workflows/remove-labels-and-assignees-on-close.yml b/.github/workflows/remove-labels-and-assignees-on-close.yml
index 04d62623cc..b23458ed2f 100644
--- a/.github/workflows/remove-labels-and-assignees-on-close.yml
+++ b/.github/workflows/remove-labels-and-assignees-on-close.yml
@@ -65,11 +65,14 @@ jobs:
}
if (context.eventName === 'pull_request' || context.eventName === 'pull_request_target') {
- const { data: closedIssues } = await github.rest.search.issuesAndPullRequests({
- q: `repo:${owner}/${repo} is:issue is:closed linked:${context.payload.pull_request.number}`,
- per_page: 100
- });
- for (const issue of closedIssues.items) {
- await processIssue(issue.number);
+ const pr = context.payload.pull_request;
+ if (pr.body) {
+ const issueReferences = pr.body.match(/#(\d+)/g);
+ if (issueReferences) {
+ for (const reference of issueReferences) {
+ const issueNumber = parseInt(reference.substring(1));
+ await processIssue(issueNumber);
+ }
+ }
}
}