Skip to content

Commit 8cd84f7

Browse files
committed
npm audit fix, format, check, build
1 parent 4494701 commit 8cd84f7

17 files changed

Lines changed: 52337 additions & 3730 deletions

File tree

dist/delete/index.js

Lines changed: 24865 additions & 930 deletions
Large diffs are not rendered by default.

dist/setup/index.js

Lines changed: 27398 additions & 2727 deletions
Large diffs are not rendered by default.

package-lock.json

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/base-tools/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const TOOL_PROVIDERS: types.IToolProvider[] = [
3333
*/
3434
export async function installBaseTools(
3535
inputs: types.IActionInputs,
36-
options: types.IDynamicOptions
36+
options: types.IDynamicOptions,
3737
) {
3838
let tools = [];
3939
let postInstallOptions = { ...options };
@@ -47,7 +47,7 @@ export async function installBaseTools(
4747
postInstallOptions = { ...postInstallOptions, ...toolUpdates.options };
4848
if (provider.postInstall) {
4949
core.info(
50-
`... we will perform post-install steps after we ${provider.label}.`
50+
`... we will perform post-install steps after we ${provider.label}.`,
5151
);
5252
postInstallActions.push(provider.postInstall);
5353
}

src/conda.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export function envCommandFlag(inputs: types.IActionInputs): string[] {
4444
*/
4545
export function condaExecutable(
4646
options: types.IDynamicOptions,
47-
subcommand?: string
47+
subcommand?: string,
4848
): string {
4949
const dir: string = condaBasePath(options);
5050
let condaExe: string;
@@ -71,7 +71,7 @@ export function isMambaInstalled(options: types.IDynamicOptions) {
7171
*/
7272
export async function condaCommand(
7373
cmd: string[],
74-
options: types.IDynamicOptions
74+
options: types.IDynamicOptions,
7575
): Promise<void> {
7676
const command = [condaExecutable(options, cmd[0]), ...cmd];
7777
return await utils.execute(command);
@@ -83,7 +83,7 @@ export async function condaCommand(
8383
export async function bootstrapConfig(): Promise<void> {
8484
await fs.promises.writeFile(
8585
constants.CONDARC_PATH,
86-
constants.BOOTSTRAP_CONDARC
86+
constants.BOOTSTRAP_CONDARC,
8787
);
8888
}
8989

@@ -93,7 +93,7 @@ export async function bootstrapConfig(): Promise<void> {
9393
export async function copyConfig(inputs: types.IActionInputs) {
9494
const sourcePath: string = path.join(
9595
process.env["GITHUB_WORKSPACE"] || "",
96-
inputs.condaConfigFile
96+
inputs.condaConfigFile,
9797
);
9898
core.info(`Copying "${sourcePath}" to "${constants.CONDARC_PATH}..."`);
9999
await io.cp(sourcePath, constants.CONDARC_PATH);
@@ -104,11 +104,11 @@ export async function copyConfig(inputs: types.IActionInputs) {
104104
*/
105105
export async function applyCondaConfiguration(
106106
inputs: types.IActionInputs,
107-
options: types.IDynamicOptions
107+
options: types.IDynamicOptions,
108108
): Promise<void> {
109109
const configEntries = Object.entries(inputs.condaConfig) as [
110110
keyof types.ICondaConfig,
111-
string
111+
string,
112112
][];
113113

114114
// Channels are special: if specified as an action input, these take priority
@@ -153,7 +153,7 @@ export async function applyCondaConfiguration(
153153
*/
154154
export async function condaInit(
155155
inputs: types.IActionInputs,
156-
options: types.IDynamicOptions
156+
options: types.IDynamicOptions,
157157
): Promise<void> {
158158
let ownPath: string;
159159
const isValidActivate = !utils.isBaseEnv(inputs.activateEnvironment);

src/delete.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ async function run(): Promise<void> {
1616

1717
if (fs.existsSync(cacheFolder) && fs.lstatSync(cacheFolder).isDirectory()) {
1818
core.startGroup(
19-
"Removing uncompressed packages to trim down cache folder..."
19+
"Removing uncompressed packages to trim down cache folder...",
2020
);
2121
let fullPath: string;
2222
for (let folder_or_file of fs.readdirSync(cacheFolder)) {

src/env/explicit.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ export const ensureExplicit: types.IEnvProvider = {
1212
condaArgs: async (inputs, options) => {
1313
if (inputs.pythonVersion) {
1414
throw Error(
15-
`'python-version: ${inputs.pythonVersion}' is incompatible with an explicit 'environmentFile`
15+
`'python-version: ${inputs.pythonVersion}' is incompatible with an explicit 'environmentFile`,
1616
);
1717
}
1818

1919
if (options.envSpec?.explicit) {
2020
outputs.setEnvironmentFileOutputs(
2121
inputs.environmentFile,
22-
options.envSpec.explicit
22+
options.envSpec.explicit,
2323
);
2424
}
2525

src/env/index.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const ENV_PROVIDERS: types.IEnvProvider[] = [
3333
*/
3434
export async function ensureEnvironment(
3535
inputs: types.IActionInputs,
36-
options: types.IDynamicOptions
36+
options: types.IDynamicOptions,
3737
): Promise<void> {
3838
for (const provider of ENV_PROVIDERS) {
3939
core.info(`Can we ${provider.label}?`);
@@ -42,13 +42,13 @@ export async function ensureEnvironment(
4242
const args = await provider.condaArgs(inputs, options);
4343
return await core.group(
4444
`Updating '${inputs.activateEnvironment}' env from ${provider.label}...`,
45-
() => conda.condaCommand(args, options)
45+
() => conda.condaCommand(args, options),
4646
);
4747
}
4848
}
4949

5050
throw Error(
51-
`'activate-environment: ${inputs.activateEnvironment}' could not be created`
51+
`'activate-environment: ${inputs.activateEnvironment}' could not be created`,
5252
);
5353
}
5454

@@ -64,15 +64,15 @@ export async function ensureEnvironment(
6464
* multiple files, alternate inputs, etc.
6565
*/
6666
export async function getEnvSpec(
67-
inputs: types.IActionInputs
67+
inputs: types.IActionInputs,
6868
): Promise<types.IEnvSpec> {
6969
if (!inputs.environmentFile) {
7070
return {};
7171
}
7272

7373
const sourceEnvironmentPath: string = path.join(
7474
process.env["GITHUB_WORKSPACE"] || "",
75-
inputs.environmentFile
75+
inputs.environmentFile,
7676
);
7777

7878
const source = fs.readFileSync(sourceEnvironmentPath, "utf8");

src/env/yaml.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ interface IYAMLEnvPatchProvider {
2323
/** Whether this patch should be applied for the given `inputs` and `options` */
2424
provides: (
2525
inputs: types.IActionInputs,
26-
options: types.IDynamicOptions
26+
options: types.IDynamicOptions,
2727
) => boolean;
2828
/** A regular expression for detecting whether a spec will need to be replaced */
2929
specMatch: RegExp;
@@ -66,7 +66,7 @@ export const ensureYaml: types.IEnvProvider = {
6666
const yamlData = options.envSpec?.yaml;
6767
if (yamlData == null) {
6868
throw Error(
69-
`'environment-file: ${inputs.environmentFile}' appears to be malformed`
69+
`'environment-file: ${inputs.environmentFile}' appears to be malformed`,
7070
);
7171
}
7272

@@ -112,10 +112,10 @@ export const ensureYaml: types.IEnvProvider = {
112112
const origParent = path.dirname(origPath);
113113
envFile = path.join(
114114
origParent,
115-
`setup-miniconda-patched-${path.basename(origPath)}`
115+
`setup-miniconda-patched-${path.basename(origPath)}`,
116116
);
117117
core.info(
118-
`Making patched copy of 'environment-file: ${inputs.environmentFile}'`
118+
`Making patched copy of 'environment-file: ${inputs.environmentFile}'`,
119119
);
120120
core.info(`Using: ${envFile}\n${patchedYaml}`);
121121
fs.writeFileSync(envFile, patchedYaml, "utf8");
@@ -124,7 +124,7 @@ export const ensureYaml: types.IEnvProvider = {
124124
core.info(`Using 'environment-file: ${inputs.environmentFile}' as-is`);
125125
outputs.setEnvironmentFileOutputs(
126126
envFile,
127-
fs.readFileSync(inputs.environmentFile, "utf-8")
127+
fs.readFileSync(inputs.environmentFile, "utf-8"),
128128
);
129129
}
130130

src/input.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@ import * as types from "./types";
1515
* network calls or subprocesses).
1616
*/
1717
interface IRule {
18-
(inputs: types.IActionInputs, condaConfig: types.ICondaConfig):
19-
| string
20-
| false;
18+
(
19+
inputs: types.IActionInputs,
20+
condaConfig: types.ICondaConfig,
21+
): string | false;
2122
}
2223

2324
const urlExt = (url: string) => path.posix.extname(new URL(url).pathname);
@@ -60,12 +61,12 @@ const RULES: IRule[] = [
6061
constants.KNOWN_EXTENSIONS
6162
}`,
6263
(
63-
i // Miniconda x86 is only published for Windows lately (last Linux was 2019, last MacOS 2015)
64+
i, // Miniconda x86 is only published for Windows lately (last Linux was 2019, last MacOS 2015)
6465
) =>
6566
!!(i.architecture === "x86" && !constants.IS_WINDOWS) &&
6667
`'architecture: ${i.architecture}' is only available for recent versions on Windows`,
6768
(
68-
i // We only support miniconda 4.6 or later (`conda init` and /condabin were added here, which we need)
69+
i, // We only support miniconda 4.6 or later (`conda init` and /condabin were added here, which we need)
6970
) =>
7071
!!(
7172
!["latest", ""].includes(i.minicondaVersion) &&
@@ -96,7 +97,7 @@ export async function parseInputs(): Promise<types.IActionInputs> {
9697
condaConfig: Object.freeze({
9798
add_anaconda_token: core.getInput("add-anaconda-token"),
9899
add_pip_as_python_dependency: core.getInput(
99-
"add-pip-as-python-dependency"
100+
"add-pip-as-python-dependency",
100101
),
101102
allow_softlinks: core.getInput("allow-softlinks"),
102103
auto_activate_base: core.getInput("auto-activate-base"),
@@ -112,7 +113,7 @@ export async function parseInputs(): Promise<types.IActionInputs> {
112113
changeps1: "false",
113114
}),
114115
cleanPatchedEnvironmentFile: core.getInput(
115-
"clean-patched-environment-file"
116+
"clean-patched-environment-file",
116117
),
117118
runPost: core.getInput("run-post"),
118119
});

0 commit comments

Comments
 (0)