-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create patched YML in place #163
Changes from 1 commit
09fee39
c7664b5
7f20cc5
04d1f60
23dfbf7
b4a992b
7a70dd6
40048d5
7ec21f1
6afc707
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,3 +34,17 @@ export async function setCacheVariable(options: types.IDynamicOptions) { | |
await conda.condaCommand(["config", "--add", "pkgs_dirs", folder], options); | ||
core.exportVariable(constants.ENV_VAR_CONDA_PKGS, folder); | ||
} | ||
|
||
/** | ||
* Export the effective environment-file path | ||
*/ | ||
export function setEnvironmentFileOutputs( | ||
envFile: string, | ||
envContent: string, | ||
patched = false | ||
): void { | ||
core.setOutput(constants.OUTPUT_ENV_FILE_PATH, path.resolve(envFile)); | ||
core.setOutput(constants.OUTPUT_ENV_FILE_CONTENT, envContent); | ||
core.setOutput(constants.OUTPUT_ENV_FILE_PATCHED, patched ? "true" : "false"); | ||
core.saveState(constants.OUTPUT_ENV_FILE_PATCHED, patched); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. gah, i didn't know about |
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -87,6 +87,15 @@ async function setupMiniconda(inputs: types.IActionInputs): Promise<void> { | |
); | ||
} | ||
|
||
if ( | ||
inputs.cleanPatchedEnvironmentFile === "true" && | ||
core.getState(constants.OUTPUT_ENV_FILE_PATCHED) | ||
) { | ||
await core.group("Cleaning up patched environment-file...", async () => | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. some future refactor could make this into a "post" step... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Mind creating an issue to keep this on the top of our heads @bollwyvl ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. raised #165! |
||
fs.unlinkSync(core.getState(constants.OUTPUT_ENV_FILE_PATH)) | ||
); | ||
} | ||
|
||
core.info("setup-miniconda ran successfully"); | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just moved these up top so they were more discoverable