Skip to content

Commit

Permalink
Misc: Limit length of labels
Browse files Browse the repository at this point in the history
  • Loading branch information
mathieudutour committed Feb 17, 2023
1 parent 5d11f32 commit d7ff1e9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion scripts/issue-bot.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ module.exports = async ({ github, context, core }) => {
issue_number: context.payload.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: [`extension: ${ext}`],
labels: [limitLabelLength(`extension: ${ext}`)],
});

try {
Expand Down Expand Up @@ -185,3 +185,7 @@ async function comment({ github, context, comment }) {
});
}
}

function limitLabelLength(label) {
return label.length > 50 ? label.substring(0, 49) + "…" : label;
}
6 changes: 5 additions & 1 deletion scripts/pr-bot.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ module.exports = async ({ github, context, core, changedFiles }) => {
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ["extension fix / improvement", `extension: ${findExtensionName(ext)}`],
labels: ["extension fix / improvement", limitLabelLength(`extension: ${findExtensionName(ext)}`)],
});

if (owners[0] === sender) {
Expand Down Expand Up @@ -143,3 +143,7 @@ async function comment({ github, context, comment }) {
});
}
}

function limitLabelLength(label) {
return label.length > 50 ? label.substring(0, 49) + "…" : label;
}

0 comments on commit d7ff1e9

Please sign in to comment.