Skip to content
This repository has been archived by the owner on Jan 5, 2024. It is now read-only.

Commit

Permalink
Fix #144: include in 'Resolved' info
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasabel committed Dec 28, 2022
1 parent cfcdd36 commit 351b58f
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 19 deletions.
17 changes: 11 additions & 6 deletions setup/dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 11 additions & 6 deletions setup/lib/opts.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 10 additions & 7 deletions setup/src/opts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export function getDefaults(os: OS): Defaults {
};
}

// Side effect: if resolution isn't the identity, print what resolved to what.
function resolve(
version: string,
supported: string[],
Expand All @@ -66,10 +67,12 @@ function resolve(
version === 'latest'
? supported[0]
: supported.find(v => v.startsWith(version)) ?? version;
return (
const result =
release_revisions?.[os]?.[tool]?.find(({from}) => from === resolved)?.to ??
resolved
);
resolved;
// Andreas 2022-12-29, issue #144: inform about resolution here where we can also output ${tool}.
if (version !== result) core.info(`Resolved ${tool} ${version} to ${result}`);
return result;
}

export function getOpts(
Expand Down Expand Up @@ -122,10 +125,10 @@ export function getOpts(
general: {matcher: {enable: !matcherDisable}}
};

// eslint-disable-next-line github/array-foreach
Object.values(opts)
.filter(t => t.enable && t.raw !== t.resolved)
.forEach(t => core.info(`Resolved ${t.raw} to ${t.resolved}`));
// // eslint-disable-next-line github/array-foreach
// Object.values(opts)
// .filter(t => t.enable && t.raw !== t.resolved)
// .forEach(t => core.info(`Resolved ${t.raw} to ${t.resolved}`));

core.debug(`Options are: ${JSON.stringify(opts)}`);
return opts;
Expand Down

0 comments on commit 351b58f

Please sign in to comment.