mirror of
https://github.com/actions/labeler.git
synced 2025-12-13 13:07:24 +00:00
Update prettier to 2.3.0 and re-prettify everything
Gotta love those trailing commas!
This commit is contained in:
@@ -27,7 +27,7 @@ export async function run() {
|
||||
const { data: pullRequest } = await client.pulls.get({
|
||||
owner: github.context.repo.owner,
|
||||
repo: github.context.repo.repo,
|
||||
pull_number: prNumber
|
||||
pull_number: prNumber,
|
||||
});
|
||||
|
||||
core.debug(`fetching changed files for pr #${prNumber}`);
|
||||
@@ -43,7 +43,7 @@ export async function run() {
|
||||
core.debug(`processing ${label}`);
|
||||
if (checkGlobs(changedFiles, globs)) {
|
||||
labels.push(label);
|
||||
} else if (pullRequest.labels.find(l => l.name === label)) {
|
||||
} else if (pullRequest.labels.find((l) => l.name === label)) {
|
||||
labelsToRemove.push(label);
|
||||
}
|
||||
}
|
||||
@@ -77,11 +77,11 @@ async function getChangedFiles(
|
||||
const listFilesOptions = client.pulls.listFiles.endpoint.merge({
|
||||
owner: github.context.repo.owner,
|
||||
repo: github.context.repo.repo,
|
||||
pull_number: prNumber
|
||||
pull_number: prNumber,
|
||||
});
|
||||
|
||||
const listFilesResponse = await client.paginate(listFilesOptions);
|
||||
const changedFiles = listFilesResponse.map(f => f.filename);
|
||||
const changedFiles = listFilesResponse.map((f) => f.filename);
|
||||
|
||||
core.debug("found changed files:");
|
||||
for (const file of changedFiles) {
|
||||
@@ -115,7 +115,7 @@ async function fetchContent(
|
||||
owner: github.context.repo.owner,
|
||||
repo: github.context.repo.repo,
|
||||
path: repoPath,
|
||||
ref: github.context.sha
|
||||
ref: github.context.sha,
|
||||
});
|
||||
|
||||
return Buffer.from(response.data.content, response.data.encoding).toString();
|
||||
@@ -143,7 +143,7 @@ function getLabelGlobMapFromObject(
|
||||
function toMatchConfig(config: StringOrMatchConfig): MatchConfig {
|
||||
if (typeof config === "string") {
|
||||
return {
|
||||
any: [config]
|
||||
any: [config],
|
||||
};
|
||||
}
|
||||
|
||||
@@ -184,7 +184,7 @@ function isMatch(changedFile: string, matchers: IMinimatch[]): boolean {
|
||||
|
||||
// equivalent to "Array.some()" but expanded for debugging and clarity
|
||||
function checkAny(changedFiles: string[], globs: string[]): boolean {
|
||||
const matchers = globs.map(g => new Minimatch(g));
|
||||
const matchers = globs.map((g) => new Minimatch(g));
|
||||
core.debug(` checking "any" patterns`);
|
||||
for (const changedFile of changedFiles) {
|
||||
if (isMatch(changedFile, matchers)) {
|
||||
@@ -199,7 +199,7 @@ function checkAny(changedFiles: string[], globs: string[]): boolean {
|
||||
|
||||
// equivalent to "Array.every()" but expanded for debugging and clarity
|
||||
function checkAll(changedFiles: string[], globs: string[]): boolean {
|
||||
const matchers = globs.map(g => new Minimatch(g));
|
||||
const matchers = globs.map((g) => new Minimatch(g));
|
||||
core.debug(` checking "all" patterns`);
|
||||
for (const changedFile of changedFiles) {
|
||||
if (!isMatch(changedFile, matchers)) {
|
||||
@@ -237,7 +237,7 @@ async function addLabels(
|
||||
owner: github.context.repo.owner,
|
||||
repo: github.context.repo.repo,
|
||||
issue_number: prNumber,
|
||||
labels: labels
|
||||
labels: labels,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -247,12 +247,12 @@ async function removeLabels(
|
||||
labels: string[]
|
||||
) {
|
||||
await Promise.all(
|
||||
labels.map(label =>
|
||||
labels.map((label) =>
|
||||
client.issues.removeLabel({
|
||||
owner: github.context.repo.owner,
|
||||
repo: github.context.repo.repo,
|
||||
issue_number: prNumber,
|
||||
name: label
|
||||
name: label,
|
||||
})
|
||||
)
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user