You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 9614aa9
Browse filesBrowse the repository at this point in the historyBrowse files
Link an issue the pull request description names when GitHub did not
- Off the default branch, link every issue after a closing keyword, as GitHub would on it
- Otherwise link the one mentioned issue assigned to the author, and name it in the reply
- Name several assigned mentions and ask which one, without linking
- Tell an unlinked author the issue comes first
Closes#112
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013PjXpbp1QSbkpzvnRwm7yv
Copy file name to clipboardExpand all lines: docs/community-automations.md
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -71,13 +71,21 @@ What happens depends on who the linked issue is assigned to:
71
71
72
72
An issue counts as linked only when the description closes it, for example `Fixes #123`. Assignments on any other issue are ignored. If the author is assigned to any linked issue, the pull request is not closed. Close contributors are never closed or labelled `unlinked`.
73
73
74
+
When nothing is linked, the automation reads the description for open issues in the same repository, as `#123`, `owner/repo#123`, or an issue URL, outside code and HTML comments, and links some itself:
75
+
76
+
- on a base other than the default branch, where GitHub ignores closing keywords: every issue after a closing keyword, whoever it is assigned to
77
+
- otherwise, the one mentioned issue assigned to the author; the reply names it
78
+
- several mentioned issues assigned to the author link none; the reply names them and asks which one
79
+
74
80
It runs on `opened`, and again on `edited` when the description changes. An edit sends no reply: it closes, labels, or removes `unlinked` by the rules above, and starts review only on a pull request that carried `unlinked`.
75
81
76
82
The weekly `unassign-inactive-issues` run closes every open pull request labelled `unlinked` for longer than `PR_UNLINKED_MAX_DAYS` days, except a close contributor's. It re-reads the links first, because a link added from the Development sidebar fires no `edited` event: a pull request now linked to its author's issue loses the label and starts review instead.
77
83
78
84
In `scripts/constants.js` set:
79
85
-`BOT_MESSAGE_PULL_REQUEST`: Message text
80
86
-`BOT_MESSAGE_LINK_ISSUE`: Text added when no issue is linked
87
+
-`BOT_MESSAGE_LINKED_ISSUE`: Text added when the automation linked the author's issue
88
+
-`BOT_MESSAGE_LINK_WHICH_ISSUE`: Text added when several mentioned issues are assigned to the author
81
89
-`BOT_MESSAGE_PULL_REQUEST_CLOSED`: Closing message when the issue is assigned to someone else
82
90
-`BOT_MESSAGE_PULL_REQUEST_UNASSIGNED`: Closing message when the issue is assigned to no one
83
91
-`BOT_MESSAGE_PULL_REQUEST_UNLINKED_CLOSED`: Closing message from the sweep when still no issue is linked
constBOT_MESSAGE_LINK_ISSUE=`**📎 We couldn't find an issue linked to this pull request.** Please edit the description and link the issue assigned to you under **References**, for example \`Fixes #123\` or \`Closes #123\`. A plain \`#123\` mention doesn't link the PR to the issue. **Pull requests with no linked issue are closed after ${PR_UNLINKED_MAX_DAYS} days.**`;
169
+
constBOT_MESSAGE_UNLINKED_DEADLINE=`**Pull requests with no linked issue are closed after ${PR_UNLINKED_MAX_DAYS} days.**`;
170
+
171
+
constBOT_MESSAGE_LINK_ISSUE=`**📎 We couldn't find an issue linked to this pull request.** Please edit the description and link the issue assigned to you under **References**, for example \`Fixes #123\` or \`Closes #123\`. A plain \`#123\` mention doesn't link the PR to the issue. ${BOT_MESSAGE_UNLINKED_DEADLINE}\n\n**Open an issue and get assigned to it before you open a pull request.** Visit [Contributing guidelines](https://learningequality.org/contributing-to-our-open-code-base) to learn about the contributing process.`;
172
+
173
+
constBOT_MESSAGE_LINKED_ISSUE=number=>
174
+
`**📎 We linked this pull request to #${number}, the issue assigned to you.** Next time, link it yourself with \`Closes #${number}\` under **References**.`;
175
+
176
+
constBOT_MESSAGE_LINK_WHICH_ISSUE=numbers=>
177
+
`**📎 This pull request mentions more than one issue assigned to you: ${numbers.map(number=>`#${number}`).join(', ')}.** Please edit the description and add \`Closes #123\` under **References** to say which one this pull request closes. ${BOT_MESSAGE_UNLINKED_DEADLINE}`;
`👋 Hi @${author}, thanks for your interest! \n\n **We're closing this pull request because ${issueUrl} isn't assigned to you.** We check and assign issues before work on them starts. Comment on the issue to ask to be assigned, and open a new pull request once you are. Visit [Contributing guidelines](https://learningequality.org/contributing-to-our-open-code-base) to learn about the contributing process.${GSOC_NOTE}`;
0 commit comments