mirror of
https://github.com/astral-sh/setup-uv.git
synced 2025-04-05 15:15:18 -04:00
Add more debug logs (#297)
This commit is contained in:
parent
a4fbf7b827
commit
1edb52594c
3 changed files with 10 additions and 0 deletions
5
dist/setup/index.js
generated
vendored
5
dist/setup/index.js
generated
vendored
|
@ -95208,6 +95208,7 @@ async function downloadVersion(platform, arch, version, checkSum, githubToken) {
|
|||
return { version: resolvedVersion, cachedToolDir };
|
||||
}
|
||||
async function resolveVersion(versionInput, githubToken) {
|
||||
core.debug(`Resolving version: ${versionInput}`);
|
||||
const version = versionInput === "latest"
|
||||
? await getLatestVersion(githubToken)
|
||||
: versionInput;
|
||||
|
@ -95216,6 +95217,7 @@ async function resolveVersion(versionInput, githubToken) {
|
|||
return version;
|
||||
}
|
||||
const availableVersions = await getAvailableVersions(githubToken);
|
||||
core.debug(`Available versions: ${availableVersions}`);
|
||||
const resolvedVersion = tc.evaluateVersions(availableVersions, version);
|
||||
if (resolvedVersion === "") {
|
||||
throw new Error(`No version found for ${version}`);
|
||||
|
@ -95246,6 +95248,7 @@ async function getReleaseTagNames(octokit) {
|
|||
return response.map((release) => release.tag_name);
|
||||
}
|
||||
async function getLatestVersion(githubToken) {
|
||||
core.debug("Getting latest version...");
|
||||
const octokit = new PaginatingOctokit({
|
||||
auth: githubToken,
|
||||
});
|
||||
|
@ -95266,6 +95269,7 @@ async function getLatestVersion(githubToken) {
|
|||
if (!latestRelease) {
|
||||
throw new Error("Could not determine latest release.");
|
||||
}
|
||||
core.debug(`Latest version: ${latestRelease.tag_name}`);
|
||||
return latestRelease.tag_name;
|
||||
}
|
||||
async function getLatestRelease(octokit) {
|
||||
|
@ -95818,6 +95822,7 @@ const node_fs_1 = __importDefault(__nccwpck_require__(3024));
|
|||
const core = __importStar(__nccwpck_require__(7484));
|
||||
const toml = __importStar(__nccwpck_require__(7106));
|
||||
function getUvVersionFromConfigFile(filePath) {
|
||||
core.debug(`Trying to find required-version for uv in: ${filePath}`);
|
||||
if (!node_fs_1.default.existsSync(filePath)) {
|
||||
core.warning(`Could not find file: ${filePath}`);
|
||||
return undefined;
|
||||
|
|
|
@ -78,6 +78,7 @@ export async function resolveVersion(
|
|||
versionInput: string,
|
||||
githubToken: string,
|
||||
): Promise<string> {
|
||||
core.debug(`Resolving version: ${versionInput}`);
|
||||
const version =
|
||||
versionInput === "latest"
|
||||
? await getLatestVersion(githubToken)
|
||||
|
@ -87,6 +88,7 @@ export async function resolveVersion(
|
|||
return version;
|
||||
}
|
||||
const availableVersions = await getAvailableVersions(githubToken);
|
||||
core.debug(`Available versions: ${availableVersions}`);
|
||||
const resolvedVersion = tc.evaluateVersions(availableVersions, version);
|
||||
if (resolvedVersion === "") {
|
||||
throw new Error(`No version found for ${version}`);
|
||||
|
@ -123,6 +125,7 @@ async function getReleaseTagNames(
|
|||
}
|
||||
|
||||
async function getLatestVersion(githubToken: string) {
|
||||
core.debug("Getting latest version...");
|
||||
const octokit = new PaginatingOctokit({
|
||||
auth: githubToken,
|
||||
});
|
||||
|
@ -145,6 +148,7 @@ async function getLatestVersion(githubToken: string) {
|
|||
if (!latestRelease) {
|
||||
throw new Error("Could not determine latest release.");
|
||||
}
|
||||
core.debug(`Latest version: ${latestRelease.tag_name}`);
|
||||
return latestRelease.tag_name;
|
||||
}
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ import * as toml from "smol-toml";
|
|||
export function getUvVersionFromConfigFile(
|
||||
filePath: string,
|
||||
): string | undefined {
|
||||
core.debug(`Trying to find required-version for uv in: ${filePath}`);
|
||||
if (!fs.existsSync(filePath)) {
|
||||
core.warning(`Could not find file: ${filePath}`);
|
||||
return undefined;
|
||||
|
|
Loading…
Add table
Reference in a new issue