in src/issue.js [28:63]
async init () {
// if author is committer, do not check if using template
const isCore = isCommitter(this.issue.author_association, this.issue.user.login);
if (!isCore) {
// TODO if neither [bug] nor [feature] in title?
this.title = (this.title || '').replace(
/(.*)(\[(?:bug|feature)\])(.*)/i,
function (match, p1, p2, p3) {
return p2 + ' ' + p1.trim() + p3.trim()
}
);
// check if the title is valid
if (this.isMissingTitle()) {
this.addLabels.push(label.MISSING_TITLE);
return;
}
// prevent from opening an issue with no template via `Reference in new issue` button
if (!this.isUsingTemplate()) {
this.addLabels.push(label.INVALID);
return;
}
this.addLabels.push(label.PENDING);
// this.addLabels.push(label.WAITING_FOR_COMMUNITY);
}
// translate issue
await this._translate();
const isInEnglish = (!this.translatedTitle && !this.translatedBody)
|| (!this.title.trim() && !this.translatedBody)
|| (!this.body.trim() && !this.translatedTitle);
if (isInEnglish) {
this.addLabels.push(label.EN);
}
}