Migrate to Biome for linting and formatting (#107)

This commit is contained in:
Charlie Marsh 2024-09-30 02:55:24 -04:00 committed by GitHub
parent 023eb7875f
commit c11f8674f8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 331 additions and 5772 deletions

View file

@ -1,9 +1,9 @@
import * as fs from "fs";
import * as crypto from "crypto";
import * as fs from "node:fs";
import * as crypto from "node:crypto";
import * as core from "@actions/core";
import { KNOWN_CHECKSUMS } from "./known-checksums";
import { Architecture, Platform } from "../../utils/platforms";
import type { Architecture, Platform } from "../../utils/platforms";
export async function validateChecksum(
checkSum: string | undefined,
@ -16,7 +16,7 @@ export async function validateChecksum(
if (checkSum !== undefined && checkSum !== "") {
isValid = await validateFileCheckSum(downloadPath, checkSum);
} else {
core.debug(`Checksum not provided. Checking known checksums.`);
core.debug("Checksum not provided. Checking known checksums.");
const key = `${arch}-${platform}-${version}`;
if (key in KNOWN_CHECKSUMS) {
const knownChecksum = KNOWN_CHECKSUMS[`${arch}-${platform}-${version}`];

View file

@ -1,4 +1,4 @@
import { promises as fs } from "fs";
import { promises as fs } from "node:fs";
import * as tc from "@actions/tool-cache";
export async function updateChecksums(
filePath: string,

View file

@ -1,8 +1,8 @@
import * as core from "@actions/core";
import * as tc from "@actions/tool-cache";
import * as exec from "@actions/exec";
import * as path from "path";
import { Architecture, Platform } from "../utils/platforms";
import * as path from "node:path";
import type { Architecture, Platform } from "../utils/platforms";
import { validateChecksum } from "./checksum/checksum";
import { OWNER, REPO, TOOL_CACHE_NAME } from "../utils/constants";

View file

@ -1,8 +1,8 @@
import * as core from "@actions/core";
import * as tc from "@actions/tool-cache";
import * as path from "path";
import * as path from "node:path";
import { OWNER, REPO, TOOL_CACHE_NAME } from "../utils/constants";
import { Architecture, Platform } from "../utils/platforms";
import type { Architecture, Platform } from "../utils/platforms";
import { validateChecksum } from "./checksum/checksum";
import * as github from "@actions/github";

View file

@ -26,7 +26,8 @@ async function saveCache(): Promise<void> {
if (!cacheKey) {
core.warning("Error retrieving cache key from state.");
return;
} else if (matchedKey === cacheKey) {
}
if (matchedKey === cacheKey) {
core.info(`Cache hit occurred on key ${cacheKey}, not saving cache.`);
return;
}

View file

@ -1,5 +1,5 @@
import * as core from "@actions/core";
import * as path from "path";
import * as path from "node:path";
import {
downloadVersion,
tryGetFromToolCache,
@ -8,10 +8,10 @@ import { restoreCache } from "./cache/restore-cache";
import { downloadLatest } from "./download/download-latest";
import {
Architecture,
type Architecture,
getArch,
getPlatform,
Platform,
type Platform,
} from "./utils/platforms";
import {
cacheLocalPath,

View file

@ -1,5 +1,5 @@
import * as core from "@actions/core";
import path from "path";
import path from "node:path";
export const version = core.getInput("version");
export const checkSum = core.getInput("checksum");