Skip to content

Commit

Permalink
ci(lint): bump
Browse files Browse the repository at this point in the history
  • Loading branch information
nekowinston committed Nov 15, 2023
1 parent 90e6830 commit 0d40fb2
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/lint/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import { basename, dirname, join } from "std/path/mod.ts";
import { globber } from "globber";

import core, { summary } from "@actions/core";
import core from "@actions/core";
// @deno-types="npm:@types/less";
import less from "less";
import usercssMeta from "usercss-meta";
Expand All @@ -18,7 +18,8 @@ const iterator = globber({
cwd: REPO_ROOT,
});

let total_missing_files = 0;
const missingFilesSummary = core.summary.addHeading("Missing files");
let totalMissingFiles = 0;

const assertions = (repo: string) => {
const pfx = "https://github.com/catppuccin/userstyles";
Expand Down Expand Up @@ -94,31 +95,30 @@ for await (const entry of iterator) {
});
});

const missing_files: string[] = [];
const missingFiles: string[] = [];
[
"catppuccin.user.css",
...["latte", "frappe", "macchiato", "mocha", "catwalk"].map((f) =>
`assets/${f}.webp`
),
].map(async (fp) => {
await Deno.stat(join(repodir, fp)).catch(() => {
missing_files.push(fp);
total_missing_files++;
missingFiles.push(fp);
totalMissingFiles++;
});
});

if (missing_files.length !== 0) {
summary.addHeading("Missing Files");
summary.addList(missing_files, true);
if (missingFiles.length !== 0) {
missingFilesSummary.addList(missingFiles, true);
}
}

// only write summary if running in github actions
if (Deno.env.has("GITHUB_STEP_SUMMARY")) {
await summary.write();
if (Deno.env.has("GITHUB_ACTIONS")) {
await missingFilesSummary.write();
}

// missing files are a fatal error
if (total_missing_files !== 0) {
if (totalMissingFiles !== 0) {
Deno.exit(1);
}

0 comments on commit 0d40fb2

Please sign in to comment.