mirror of
https://github.com/Koenkk/zigbee-OTA.git
synced 2026-09-19 02:58:40 +00:00
fix(ignore): Migrate to Biome 2 (#791)
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import type {ExtraMetas} from "../types.js";
|
||||
|
||||
import {getJson, getLatestImage, readCacheJson, writeCacheJson} from "../common.js";
|
||||
import {processFirmwareImage} from "../process_firmware_image.js";
|
||||
import type {ExtraMetas} from "../types.js";
|
||||
|
||||
type ReleaseAssetJson = {
|
||||
url: string;
|
||||
|
||||
+1
-2
@@ -1,10 +1,9 @@
|
||||
import type {ExtraMetas, ExtraMetasWithFileName, ImageHeader, RepoImageMeta} from "./types";
|
||||
|
||||
import assert from "node:assert";
|
||||
import {exec} from "node:child_process";
|
||||
import {createHash} from "node:crypto";
|
||||
import {existsSync, mkdirSync, readFileSync, renameSync, rmSync, writeFileSync} from "node:fs";
|
||||
import path from "node:path";
|
||||
import type {ExtraMetas, ExtraMetasWithFileName, ImageHeader, RepoImageMeta} from "./types";
|
||||
|
||||
export const UPGRADE_FILE_IDENTIFIER = Buffer.from([0x1e, 0xf1, 0xee, 0x0b]);
|
||||
export const BASE_REPO_URL = "https://raw.githubusercontent.com/Koenkk/zigbee-OTA/";
|
||||
|
||||
@@ -1,18 +1,17 @@
|
||||
import assert from "node:assert";
|
||||
import {existsSync, mkdirSync, writeFileSync} from "node:fs";
|
||||
import type CoreApi from "@actions/core";
|
||||
import type {Context} from "@actions/github/lib/context";
|
||||
import type {Octokit} from "@octokit/rest";
|
||||
|
||||
import assert from "node:assert";
|
||||
import {existsSync, mkdirSync, writeFileSync} from "node:fs";
|
||||
|
||||
import {
|
||||
BASE_INDEX_MANIFEST_FILENAME,
|
||||
PREV_INDEX_MANIFEST_FILENAME,
|
||||
execute,
|
||||
PR_ARTIFACT_DIFF_FILEPATH,
|
||||
PR_ARTIFACT_DIR,
|
||||
PR_ARTIFACT_ERROR_FILEPATH,
|
||||
PR_ARTIFACT_NUMBER_FILEPATH,
|
||||
execute,
|
||||
PREV_INDEX_MANIFEST_FILENAME,
|
||||
readManifest,
|
||||
writeManifest,
|
||||
} from "./common.js";
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
import {readdirSync, readFileSync, writeFileSync} from "node:fs";
|
||||
import path from "node:path";
|
||||
import type CoreApi from "@actions/core";
|
||||
import type {Context} from "@actions/github/lib/context";
|
||||
import type {Octokit} from "@octokit/rest";
|
||||
|
||||
import {readFileSync, readdirSync, writeFileSync} from "node:fs";
|
||||
import path from "node:path";
|
||||
|
||||
export const CACERTS_DIR = "cacerts";
|
||||
export const CACERTS_CONCAT_FILEPATH = "cacerts.pem";
|
||||
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
import type CoreApi from "@actions/core";
|
||||
import type {Context} from "@actions/github/lib/context";
|
||||
import type {Octokit} from "@octokit/rest";
|
||||
|
||||
import {BASE_IMAGES_DIR, BASE_INDEX_MANIFEST_FILENAME, execute, PREV_IMAGES_DIR, PREV_INDEX_MANIFEST_FILENAME, readManifest} from "./common.js";
|
||||
import type {RepoImageMeta} from "./types.js";
|
||||
|
||||
import {BASE_IMAGES_DIR, BASE_INDEX_MANIFEST_FILENAME, PREV_IMAGES_DIR, PREV_INDEX_MANIFEST_FILENAME, execute, readManifest} from "./common.js";
|
||||
|
||||
// about 3 lines
|
||||
const MAX_RELEASE_NOTES_LENGTH = 380;
|
||||
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
import assert from "node:assert";
|
||||
import type CoreApi from "@actions/core";
|
||||
import type {Context} from "@actions/github/lib/context";
|
||||
import type {Octokit} from "@octokit/rest";
|
||||
|
||||
import assert from "node:assert";
|
||||
|
||||
const IGNORE_OTA_WORKFLOW_LABEL = "ignore-ota-workflow";
|
||||
|
||||
export async function createPRToDefault(
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
import assert from "node:assert";
|
||||
import type CoreApi from "@actions/core";
|
||||
import type {Context} from "@actions/github/lib/context";
|
||||
import type {Octokit} from "@octokit/rest";
|
||||
|
||||
import assert from "node:assert";
|
||||
|
||||
import {BASE_IMAGES_DIR} from "./common.js";
|
||||
|
||||
export async function getChangedOtaFiles(
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
import {readFileSync, writeFileSync} from "node:fs";
|
||||
import {join} from "node:path";
|
||||
import type CoreApi from "@actions/core";
|
||||
import type {Context} from "@actions/github/lib/context";
|
||||
import type {Octokit} from "@octokit/rest";
|
||||
|
||||
import {readFileSync, writeFileSync} from "node:fs";
|
||||
import {join} from "node:path";
|
||||
|
||||
import {BASE_INDEX_MANIFEST_FILENAME, BASE_REPO_URL, REPO_BRANCH, UPGRADE_FILE_IDENTIFIER, parseImageHeader, readManifest} from "./common.js";
|
||||
import {BASE_INDEX_MANIFEST_FILENAME, BASE_REPO_URL, parseImageHeader, REPO_BRANCH, readManifest, UPGRADE_FILE_IDENTIFIER} from "./common.js";
|
||||
|
||||
enum ZigBeeStackVersion {
|
||||
ZigBee2006 = 0x0000,
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
import {existsSync, mkdirSync} from "node:fs";
|
||||
import type CoreApi from "@actions/core";
|
||||
import type {Context} from "@actions/github/lib/context";
|
||||
import type {Octokit} from "@octokit/rest";
|
||||
|
||||
import {existsSync, mkdirSync} from "node:fs";
|
||||
|
||||
import {ALL_AUTODL_MANUFACTURERS, CACHE_DIR} from "./common.js";
|
||||
|
||||
export async function overwriteCache(github: Octokit, core: typeof CoreApi, context: Context, manufacturersCSV?: string): Promise<void> {
|
||||
|
||||
@@ -1,26 +1,23 @@
|
||||
import type CoreApi from "@actions/core";
|
||||
import type {Context} from "@actions/github/lib/context";
|
||||
import type {Octokit} from "@octokit/rest";
|
||||
|
||||
import type {ExtraMetas, GHExtraMetas, RepoImageMeta} from "./types.js";
|
||||
|
||||
import assert from "node:assert";
|
||||
import {readFileSync, renameSync} from "node:fs";
|
||||
import path from "node:path";
|
||||
|
||||
import type CoreApi from "@actions/core";
|
||||
import type {Context} from "@actions/github/lib/context";
|
||||
import type {Octokit} from "@octokit/rest";
|
||||
import {
|
||||
BASE_IMAGES_DIR,
|
||||
PREV_IMAGES_DIR,
|
||||
ParsedImageStatus,
|
||||
UPGRADE_FILE_IDENTIFIER,
|
||||
addImageToBase,
|
||||
addImageToPrev,
|
||||
BASE_IMAGES_DIR,
|
||||
findMatchImage,
|
||||
getOutDir,
|
||||
getParsedImageStatus,
|
||||
getValidMetas,
|
||||
ParsedImageStatus,
|
||||
PREV_IMAGES_DIR,
|
||||
parseImageHeader,
|
||||
UPGRADE_FILE_IDENTIFIER,
|
||||
} from "./common.js";
|
||||
import type {ExtraMetas, GHExtraMetas, RepoImageMeta} from "./types.js";
|
||||
|
||||
const EXTRA_METAS_PR_BODY_START_TAG = "```json";
|
||||
const EXTRA_METAS_PR_BODY_END_TAG = "```";
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
import assert from "node:assert";
|
||||
import {existsSync, readFileSync, writeFileSync} from "node:fs";
|
||||
import type CoreApi from "@actions/core";
|
||||
import type {Context} from "@actions/github/lib/context";
|
||||
import type {Octokit} from "@octokit/rest";
|
||||
|
||||
import assert from "node:assert";
|
||||
import {existsSync, readFileSync, writeFileSync} from "node:fs";
|
||||
|
||||
import {PR_ARTIFACT_DIR, PR_DIFF_FILENAME, PR_ERROR_FILENAME, PR_NUMBER_FILENAME, execute} from "./common.js";
|
||||
import {execute, PR_ARTIFACT_DIR, PR_DIFF_FILENAME, PR_ERROR_FILENAME, PR_NUMBER_FILENAME} from "./common.js";
|
||||
|
||||
export async function reportOtaPR(github: Octokit, core: typeof CoreApi, context: Context): Promise<void> {
|
||||
assert(context.payload.workflow_run, "Not a workflow run");
|
||||
|
||||
@@ -1,33 +1,30 @@
|
||||
import {existsSync, lstatSync, mkdirSync, readdirSync, readFileSync, renameSync, rmSync, writeFileSync} from "node:fs";
|
||||
import path from "node:path";
|
||||
import type CoreApi from "@actions/core";
|
||||
import type {Context} from "@actions/github/lib/context";
|
||||
import type {Octokit} from "@octokit/rest";
|
||||
|
||||
import type {RepoImageMeta} from "./types";
|
||||
|
||||
import {existsSync, lstatSync, mkdirSync, readFileSync, readdirSync, renameSync, rmSync, writeFileSync} from "node:fs";
|
||||
import path from "node:path";
|
||||
|
||||
import {
|
||||
addImageToBase,
|
||||
addImageToPrev,
|
||||
BASE_IMAGES_DIR,
|
||||
BASE_INDEX_MANIFEST_FILENAME,
|
||||
BASE_REPO_URL,
|
||||
PREV_IMAGES_DIR,
|
||||
PREV_INDEX_MANIFEST_FILENAME,
|
||||
ParsedImageStatus,
|
||||
REPO_BRANCH,
|
||||
UPGRADE_FILE_IDENTIFIER,
|
||||
addImageToBase,
|
||||
addImageToPrev,
|
||||
computeSHA512,
|
||||
findMatchImage,
|
||||
getOutDir,
|
||||
getParsedImageStatus,
|
||||
getRepoFirmwareFileUrl,
|
||||
getValidMetas,
|
||||
ParsedImageStatus,
|
||||
PREV_IMAGES_DIR,
|
||||
PREV_INDEX_MANIFEST_FILENAME,
|
||||
parseImageHeader,
|
||||
REPO_BRANCH,
|
||||
readManifest,
|
||||
UPGRADE_FILE_IDENTIFIER,
|
||||
writeManifest,
|
||||
} from "./common.js";
|
||||
import type {RepoImageMeta} from "./types";
|
||||
|
||||
/** These are now handled by autodl */
|
||||
const IGNORE_3RD_PARTIES = ["https://github.com/fairecasoimeme/", "https://github.com/xyzroe/"];
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
import {existsSync, mkdirSync, rmSync} from "node:fs";
|
||||
import type CoreApi from "@actions/core";
|
||||
import type {Context} from "@actions/github/lib/context";
|
||||
import type {Octokit} from "@octokit/rest";
|
||||
|
||||
import {existsSync, mkdirSync, rmSync} from "node:fs";
|
||||
|
||||
import {ALL_AUTODL_MANUFACTURERS, BASE_INDEX_MANIFEST_FILENAME, CACHE_DIR, PREV_INDEX_MANIFEST_FILENAME, TMP_DIR, writeManifest} from "./common.js";
|
||||
|
||||
export async function runAutodl(github: Octokit, core: typeof CoreApi, context: Context, manufacturersCSV?: string): Promise<void> {
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
import assert from "node:assert";
|
||||
import type CoreApi from "@actions/core";
|
||||
import type {Context} from "@actions/github/lib/context";
|
||||
import type {Octokit} from "@octokit/rest";
|
||||
|
||||
import assert from "node:assert";
|
||||
|
||||
import {BASE_INDEX_MANIFEST_FILENAME, PREV_INDEX_MANIFEST_FILENAME, readManifest, writeManifest} from "./common.js";
|
||||
import {getChangedOtaFiles} from "./ghw_get_changed_ota_files.js";
|
||||
import {processOtaFiles} from "./ghw_process_ota_files.js";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import {readFileSync} from "node:fs";
|
||||
|
||||
import {UPGRADE_FILE_IDENTIFIER, parseImageHeader} from "./common.js";
|
||||
import {parseImageHeader, UPGRADE_FILE_IDENTIFIER} from "./common.js";
|
||||
|
||||
const firmwareBuffer = readFileSync(process.argv[2]);
|
||||
|
||||
|
||||
@@ -1,28 +1,25 @@
|
||||
import type {ExtraMetas} from "./types";
|
||||
|
||||
import assert from "node:assert";
|
||||
import {readFileSync, readdirSync, renameSync, rmSync, writeFileSync} from "node:fs";
|
||||
import {readdirSync, readFileSync, renameSync, rmSync, writeFileSync} from "node:fs";
|
||||
import path from "node:path";
|
||||
|
||||
import {extract} from "tar";
|
||||
|
||||
import {
|
||||
BASE_IMAGES_DIR,
|
||||
BASE_INDEX_MANIFEST_FILENAME,
|
||||
PREV_IMAGES_DIR,
|
||||
PREV_INDEX_MANIFEST_FILENAME,
|
||||
ParsedImageStatus,
|
||||
TMP_DIR,
|
||||
UPGRADE_FILE_IDENTIFIER,
|
||||
addImageToBase,
|
||||
addImageToPrev,
|
||||
BASE_IMAGES_DIR,
|
||||
BASE_INDEX_MANIFEST_FILENAME,
|
||||
findMatchImage,
|
||||
getOutDir,
|
||||
getParsedImageStatus,
|
||||
ParsedImageStatus,
|
||||
PREV_IMAGES_DIR,
|
||||
PREV_INDEX_MANIFEST_FILENAME,
|
||||
parseImageHeader,
|
||||
readManifest,
|
||||
TMP_DIR,
|
||||
UPGRADE_FILE_IDENTIFIER,
|
||||
writeManifest,
|
||||
} from "./common.js";
|
||||
import type {ExtraMetas} from "./types";
|
||||
|
||||
export enum ProcessFirmwareImageStatus {
|
||||
Error = -1,
|
||||
|
||||
Reference in New Issue
Block a user