Skip to content

Commit

Permalink
[v 0.2.9]: new release of i18n-action
Browse files Browse the repository at this point in the history
  • Loading branch information
inlang-bot committed Mar 18, 2024
1 parent 7bc6323 commit 504f704
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions dist/index.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -61278,6 +61278,12 @@ async function run() {
});
}
for (const result of results) {
if (projectListHead.some(
(project) => project.projectPath.replace(process.cwd(), "") === result.projectPath
) === false) {
console.debug(`Project ${result.projectPath} not found in head repo`);
continue;
}
const projectHead = await loadProject({
projectPath: process.cwd() + result.projectPath,
repo: repoHead,
Expand All @@ -61289,6 +61295,12 @@ async function run() {
console.debug("Skip project ", result.projectPath, " in head repo because of errors");
continue;
}
const newInstalledRules = projectHead.installed.messageLintRules();
for (const newRule of newInstalledRules) {
if (!result.installedRules.some((rule) => rule.id === newRule.id)) {
result.installedRules.push(newRule);
}
}
result?.reportsHead.push(...projectHead.query.messageLintReports.getAll());
}
for (const result of results) {
Expand All @@ -61303,9 +61315,6 @@ async function run() {
result.changedIds = LintSummary.changedIds;
}
for (const result of results) {
if (result.errorsBase.length > 0 && result.errorsHead.length === 0) {
console.debug(`#### \u2705 Setup of project \`${result.projectPath}\` fixed`);
}
const shortenedProjectPath = () => {
const parts = result.projectPath.split("/");
if (parts.length > 2) {
Expand All @@ -61314,6 +61323,13 @@ async function run() {
return result.projectPath;
}
};
if (projectListHead.some(
(project) => project.projectPath.replace(process.cwd(), "") === result.projectPath
) === false) {
result.commentContent = `#### \u2757\uFE0F Project \`${shortenedProjectPath()}\` not found in head repo.
If you have not intentionally deleted the project, check whether the head repository is up to date with the base repository.`;
continue;
}
if (result.errorsBase.length === 0 && result.errorsHead.length > 0) {
result.commentContent = `#### \u2757\uFE0F New errors in setup of project \`${shortenedProjectPath()}\` found
${result.errorsHead.map((error) => {
Expand All @@ -61337,6 +61353,9 @@ ${error?.cause.stack}`;
}).join("\n")}`;
continue;
}
if (result.errorsBase.length > 0 && result.errorsHead.length === 0) {
console.debug(`#### \u2705 Setup of project \`${result.projectPath}\` fixed`);
}
if (result.errorsBase.length > 0 || result.errorsHead.length > 0)
continue;
if (result.lintSummary.length === 0)
Expand Down

0 comments on commit 504f704

Please sign in to comment.