diff --git a/dist/ruff-action/index.js b/dist/ruff-action/index.js index 41a9d13..1e9bd2f 100644 Binary files a/dist/ruff-action/index.js and b/dist/ruff-action/index.js differ diff --git a/package-lock.json b/package-lock.json index 8abe58d..8c51dcb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,7 +13,7 @@ "@actions/exec": "^1.1.1", "@actions/github": "^6.0.0", "@actions/tool-cache": "^2.0.1", - "toml": "^3.0.0" + "@iarna/toml": "^2.2.5" }, "devDependencies": { "@biomejs/biome": "1.9.4", @@ -242,6 +242,11 @@ "node": ">=14" } }, + "node_modules/@iarna/toml": { + "version": "2.2.5", + "resolved": "https://registry.npmjs.org/@iarna/toml/-/toml-2.2.5.tgz", + "integrity": "sha512-trnsAYxU3xnS1gPHPyU961coFyLkh4gAD/0zQ5mymY4yOZ+CYvsPqUbOFSw0aDM4y0tV7tiFxL/1XfXPNC6IPg==" + }, "node_modules/@octokit/auth-token": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-4.0.0.tgz", @@ -454,11 +459,6 @@ "semver": "bin/semver.js" } }, - "node_modules/toml": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/toml/-/toml-3.0.0.tgz", - "integrity": "sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==" - }, "node_modules/tunnel": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", diff --git a/package.json b/package.json index bee93b8..89d4a25 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "@actions/exec": "^1.1.1", "@actions/github": "^6.0.0", "@actions/tool-cache": "^2.0.1", - "toml": "^3.0.0" + "@iarna/toml": "^2.2.5" }, "devDependencies": { "@biomejs/biome": "1.9.4", diff --git a/src/utils/pyproject.ts b/src/utils/pyproject.ts index ad0c778..afcbf89 100644 --- a/src/utils/pyproject.ts +++ b/src/utils/pyproject.ts @@ -1,15 +1,18 @@ import * as fs from "node:fs"; import * as core from "@actions/core"; -import * as toml from "toml"; +import * as toml from "@iarna/toml"; export function getRuffVersionFromPyproject( filePath: string, ): string | undefined { const pyprojectContent = fs.readFileSync(filePath, "utf-8"); - const pyproject = toml.parse(pyprojectContent); + const pyproject = toml.parse(pyprojectContent) as { + project?: { dependencies?: string[] }; + "dependency-groups"?: { dev?: string[] }; + }; - const dependencies: string[] = pyproject.project?.dependencies || []; - const devDependencies: string[] = pyproject["dependency-groups"]?.dev || []; + const dependencies: string[] = pyproject?.project?.dependencies || []; + const devDependencies: string[] = pyproject?.["dependency-groups"]?.dev || []; const ruffVersionDefinition = dependencies.find((dep: string) => dep.startsWith("ruff")) ||