Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"@typescript-eslint"
],
"rules": {
"arrow-parens": ["warn", "always"],
"brace-style": ["warn", "1tbs"],
"camelcase": ["warn", {
"properties": "never",
Expand Down
4 changes: 2 additions & 2 deletions src/class/prsOpen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export default class PullRequestOpen {
repo: "github-AutoResponse",
pull_number: this.context.payload.number
}).then(async (res) => {
const listFiles = res.data.map(a => a.filename);
const listFiles = res.data.map((a) => a.filename);
for (let i = 0; i < listFiles.length; i++) {
if (/src\/index/i.test(listFiles[i])) {
fileLabels.push("Core");
Expand All @@ -79,7 +79,7 @@ export default class PullRequestOpen {
}

if (fileLabels.length > 0) {
new Set(fileLabels).forEach(a => filteredlabels.push(a));
new Set(fileLabels).forEach((a) => filteredlabels.push(a));
await this.context.octokit.issues.addLabels(
this.context.issue({
labels: filteredlabels
Expand Down
20 changes: 10 additions & 10 deletions src/class/prsReview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default class PullRequestReview {
body: `@${this.context.payload.pull_request.user.login} your pull request has been approved by @${this.context.payload.review.user.login}, please type \`Ready to merge\` for merging`,
event: "COMMENT"
});
if (this.context.payload.pull_request.labels.find(a => a.name == "Requested Changes")) {
if (this.context.payload.pull_request.labels.find((a) => a.name == "Requested Changes")) {
await this.context.octokit.issues.removeLabel(
this.context.issue({
name: "Requested Changes"
Expand Down Expand Up @@ -76,7 +76,7 @@ export default class PullRequestReview {
body: `Pull request has requested changes by @${this.context.payload.review.user.login}. PING! @${this.context.payload.pull_request.user.login} Please address their comments before I'm merging this PR, thanks!`,
event: "COMMENT"
});
if (this.context.payload.pull_request.labels.find(a => a.name == "Approved")) {
if (this.context.payload.pull_request.labels.find((a) => a.name == "Approved")) {
await this.context.octokit.issues.removeLabel(
this.context.issue({
name: "Approved"
Expand Down Expand Up @@ -117,7 +117,7 @@ export default class PullRequestReview {
body: `@${this.context.payload.pull_request.user.login} your pull request has been approved by \`[MAINTAINER]\`@${this.context.payload.review.user.login}, please type \`Ready to merge\` for merging`,
event: "COMMENT"
});
if (this.context.payload.pull_request.labels.find(a => a.name == "Requested Changes")) {
if (this.context.payload.pull_request.labels.find((a) => a.name == "Requested Changes")) {
await this.context.octokit.issues.removeLabel(
this.context.issue({
name: "Requested Changes"
Expand Down Expand Up @@ -156,7 +156,7 @@ export default class PullRequestReview {
body: `Pull request has requested changes by @${this.context.payload.review.user.login}. PING! @${this.context.payload.pull_request.user.login} Please address their comments before I'm merging this PR, thanks!`,
event: "COMMENT"
});
if (this.context.payload.pull_request.labels.find(a => a.name == "Approved")) {
if (this.context.payload.pull_request.labels.find((a) => a.name == "Approved")) {
await this.context.octokit.issues.removeLabel(
this.context.issue({
name: "Approved"
Expand Down Expand Up @@ -198,7 +198,7 @@ export default class PullRequestReview {
body: `@${this.context.payload.pull_request.user.login} your pull request has been approved by @${this.context.payload.review.user.login}, even though please wait for the \`MAINTAINERS\`/\`CODEOWNERS\` to review`,
event: "COMMENT"
});
if (this.context.payload.pull_request.labels.find(a => a.name == "Requested Changes")) {
if (this.context.payload.pull_request.labels.find((a) => a.name == "Requested Changes")) {
await this.context.octokit.issues.removeLabel(
this.context.issue({
name: "Requested Changes"
Expand Down Expand Up @@ -268,7 +268,7 @@ export default class PullRequestReview {
body: `@${this.context.payload.pull_request.user.login} Pull request has been approved by \`[OWNER]\`@${this.context.payload.review.user.login}, please type \`Merge\` for merging @${this.context.payload.review.user.login}`,
event: "COMMENT"
});
if (this.context.payload.pull_request.labels.find(a => a.name == "Requested Changes")) {
if (this.context.payload.pull_request.labels.find((a) => a.name == "Requested Changes")) {
await this.context.octokit.issues.removeLabel(
this.context.issue({
name: "Requested Changes"
Expand Down Expand Up @@ -307,7 +307,7 @@ export default class PullRequestReview {
body: `@${this.context.payload.pull_request.user.login} your pull request has requested changes by \`[OWNER]\`@${this.context.payload.review.user.login}. Please address their comments before I'm merging this PR, thanks!`,
event: "COMMENT"
});
if (this.context.payload.pull_request.labels.find(a => a.name == "Approved")) {
if (this.context.payload.pull_request.labels.find((a) => a.name == "Approved")) {
await this.context.octokit.issues.removeLabel(
this.context.issue({
name: "Approved"
Expand Down Expand Up @@ -348,7 +348,7 @@ export default class PullRequestReview {
body: `@${this.context.payload.pull_request.user.login} Pull request has been approved by \`[MAINTAINER]\`@${this.context.payload.review.user.login}, please type \`Merge\` for merging @${this.context.payload.review.user.login}`,
event: "COMMENT"
});
if (this.context.payload.pull_request.labels.find(a => a.name == "Requested Changes")) {
if (this.context.payload.pull_request.labels.find((a) => a.name == "Requested Changes")) {
await this.context.octokit.issues.removeLabel(
this.context.issue({
name: "Requested Changes"
Expand Down Expand Up @@ -387,7 +387,7 @@ export default class PullRequestReview {
body: `Pull request has requested changes by \`[MAINTAINER]\`@${this.context.payload.review.user.login}. PING! @${this.context.payload.pull_request.user.login} Please address their comments before I"m merging this PR, thanks!`,
event: "COMMENT"
});
if (this.context.payload.pull_request.labels.find(a => a.name == "Approved")) {
if (this.context.payload.pull_request.labels.find((a) => a.name == "Approved")) {
await this.context.octokit.issues.removeLabel(
this.context.issue({
name: "Approved"
Expand Down Expand Up @@ -429,7 +429,7 @@ export default class PullRequestReview {
body: `@${this.context.payload.pull_request.user.login} your pull request has been approved by @${this.context.payload.review.user.login}, even though please wait for the \`MAINTAINERS\`/\`CODEOWNERS\` to review`,
event: "COMMENT"
});
if (this.context.payload.pull_request.labels.find(a => a.name == "Requested Changes")) {
if (this.context.payload.pull_request.labels.find((a) => a.name == "Requested Changes")) {
await this.context.octokit.issues.removeLabel(
this.context.issue({
name: "Requested Changes"
Expand Down
8 changes: 4 additions & 4 deletions src/class/prsSynchronize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default class PullRequestSynchronize {
issue_number: this.context.payload.pull_request.number
}).then(async (res) => {
let i: number;
const prsLabels = res.data.find(a => a.name == "Requested Changes" || a.name == "Approved")?.name;
const prsLabels = res.data.find((a) => a.name == "Requested Changes" || a.name == "Approved")?.name;
if (prsLabels) {
await this.context.octokit.pulls.listReviews({
owner: this.context.payload.repository.owner.login,
Expand All @@ -48,8 +48,8 @@ export default class PullRequestSynchronize {
"CHANGES_REQUESTED",
"APPROVED"
];
if (res.data[i].state == datastate.find(a => a == res.data[i].state)) {
if (res.data[i].user?.login != reviewersArray.find(a => a == res.data[i].user?.login)) {
if (res.data[i].state == datastate.find((a) => a == res.data[i].state)) {
if (res.data[i].user?.login != reviewersArray.find((a) => a == res.data[i].user?.login)) {
const username: string = res.data[i].user?.login || "";
reviewersArray.push(username);
tagReviewers.push("@" + username);
Expand Down Expand Up @@ -124,7 +124,7 @@ export default class PullRequestSynchronize {
repo: this.context.payload.repository.name,
issue_number: this.context.payload.pull_request.number
}).then(async (res) => {
if (res.data.find(a => a.name == "Config Invalid")) {
if (res.data.find((a) => a.name == "Config Invalid")) {
await this.context.octokit.issues.removeLabel(
this.context.issue({
name: "Config Invalid"
Expand Down
2 changes: 1 addition & 1 deletion src/class/workflowCheck.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export default class WorkflowCheck {
repo: this.context.payload.repository.name,
pull_number: prsNumber
}).then(async (res) => {
if (res.data.labels.find(a => a.name == "CI Failed")) {
if (res.data.labels.find((a) => a.name == "CI Failed")) {
await this.context.octokit.issues.removeLabel(
this.context.issue({
owner: this.context.payload.repository.owner.login,
Expand Down