Add more debug logs (#297)

This commit is contained in:
Kevin Stillhammer 2025-02-21 11:10:37 +01:00 committed by GitHub
parent a4fbf7b827
commit 1edb52594c
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG key ID: B5690EEEBB952194
3 changed files with 10 additions and 0 deletions

5
dist/setup/index.js generated vendored
View file

@ -95208,6 +95208,7 @@ async function downloadVersion(platform, arch, version, checkSum, githubToken) {
return { version: resolvedVersion, cachedToolDir }; return { version: resolvedVersion, cachedToolDir };
} }
async function resolveVersion(versionInput, githubToken) { async function resolveVersion(versionInput, githubToken) {
core.debug(`Resolving version: ${versionInput}`);
const version = versionInput === "latest" const version = versionInput === "latest"
? await getLatestVersion(githubToken) ? await getLatestVersion(githubToken)
: versionInput; : versionInput;
@ -95216,6 +95217,7 @@ async function resolveVersion(versionInput, githubToken) {
return version; return version;
} }
const availableVersions = await getAvailableVersions(githubToken); const availableVersions = await getAvailableVersions(githubToken);
core.debug(`Available versions: ${availableVersions}`);
const resolvedVersion = tc.evaluateVersions(availableVersions, version); const resolvedVersion = tc.evaluateVersions(availableVersions, version);
if (resolvedVersion === "") { if (resolvedVersion === "") {
throw new Error(`No version found for ${version}`); throw new Error(`No version found for ${version}`);
@ -95246,6 +95248,7 @@ async function getReleaseTagNames(octokit) {
return response.map((release) => release.tag_name); return response.map((release) => release.tag_name);
} }
async function getLatestVersion(githubToken) { async function getLatestVersion(githubToken) {
core.debug("Getting latest version...");
const octokit = new PaginatingOctokit({ const octokit = new PaginatingOctokit({
auth: githubToken, auth: githubToken,
}); });
@ -95266,6 +95269,7 @@ async function getLatestVersion(githubToken) {
if (!latestRelease) { if (!latestRelease) {
throw new Error("Could not determine latest release."); throw new Error("Could not determine latest release.");
} }
core.debug(`Latest version: ${latestRelease.tag_name}`);
return latestRelease.tag_name; return latestRelease.tag_name;
} }
async function getLatestRelease(octokit) { async function getLatestRelease(octokit) {
@ -95818,6 +95822,7 @@ const node_fs_1 = __importDefault(__nccwpck_require__(3024));
const core = __importStar(__nccwpck_require__(7484)); const core = __importStar(__nccwpck_require__(7484));
const toml = __importStar(__nccwpck_require__(7106)); const toml = __importStar(__nccwpck_require__(7106));
function getUvVersionFromConfigFile(filePath) { function getUvVersionFromConfigFile(filePath) {
core.debug(`Trying to find required-version for uv in: ${filePath}`);
if (!node_fs_1.default.existsSync(filePath)) { if (!node_fs_1.default.existsSync(filePath)) {
core.warning(`Could not find file: ${filePath}`); core.warning(`Could not find file: ${filePath}`);
return undefined; return undefined;

View file

@ -78,6 +78,7 @@ export async function resolveVersion(
versionInput: string, versionInput: string,
githubToken: string, githubToken: string,
): Promise<string> { ): Promise<string> {
core.debug(`Resolving version: ${versionInput}`);
const version = const version =
versionInput === "latest" versionInput === "latest"
? await getLatestVersion(githubToken) ? await getLatestVersion(githubToken)
@ -87,6 +88,7 @@ export async function resolveVersion(
return version; return version;
} }
const availableVersions = await getAvailableVersions(githubToken); const availableVersions = await getAvailableVersions(githubToken);
core.debug(`Available versions: ${availableVersions}`);
const resolvedVersion = tc.evaluateVersions(availableVersions, version); const resolvedVersion = tc.evaluateVersions(availableVersions, version);
if (resolvedVersion === "") { if (resolvedVersion === "") {
throw new Error(`No version found for ${version}`); throw new Error(`No version found for ${version}`);
@ -123,6 +125,7 @@ async function getReleaseTagNames(
} }
async function getLatestVersion(githubToken: string) { async function getLatestVersion(githubToken: string) {
core.debug("Getting latest version...");
const octokit = new PaginatingOctokit({ const octokit = new PaginatingOctokit({
auth: githubToken, auth: githubToken,
}); });
@ -145,6 +148,7 @@ async function getLatestVersion(githubToken: string) {
if (!latestRelease) { if (!latestRelease) {
throw new Error("Could not determine latest release."); throw new Error("Could not determine latest release.");
} }
core.debug(`Latest version: ${latestRelease.tag_name}`);
return latestRelease.tag_name; return latestRelease.tag_name;
} }

View file

@ -5,6 +5,7 @@ import * as toml from "smol-toml";
export function getUvVersionFromConfigFile( export function getUvVersionFromConfigFile(
filePath: string, filePath: string,
): string | undefined { ): string | undefined {
core.debug(`Trying to find required-version for uv in: ${filePath}`);
if (!fs.existsSync(filePath)) { if (!fs.existsSync(filePath)) {
core.warning(`Could not find file: ${filePath}`); core.warning(`Could not find file: ${filePath}`);
return undefined; return undefined;