Closed
Conversation
There was a problem hiding this comment.
Pull request overview
Updates documentation and workflow examples for running setup-miniconda in restricted environments, and adjusts the post-step package-cache trimming behavior.
Changes:
- Add README guidance for environments where modifying shell profiles is restricted.
- Change
deletepost action to stash extracted conda packages (rename to sibling stash dir) and clean prior stashes to avoid slow recursive deletes on Windows. - Bump cache reset numbers and update an example workflow to use the local action (
./).
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| src/delete.ts | Switches from recursive deletion to stashing extracted package dirs + cleanup of prior stashes. |
| dist/delete/index.js | Rebuilt bundled output for the updated delete post action. |
| README.md | Adds a “Restricted environments” section with suggested activation patterns. |
| .github/workflows/caching-example.yml | Bumps CACHE_NUMBER to reset caches for the example. |
| .github/workflows/caching-envs-example.yml | Updates example to use the local action and bumps cache reset number. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const pkgsDirs = utils.parsePkgsDirs(inputs.condaConfig.pkgs_dirs); | ||
| if (!pkgsDirs.length) return; | ||
| core.startGroup( | ||
| "Removing uncompressed packages to trim down packages directory...", |
| // Clean up stash directories left by previous runs (self-hosted runners) | ||
| const parentDir = path.dirname(pkgsDir); | ||
| const baseName = path.basename(pkgsDir); | ||
| for (const sibling of fs.readdirSync(parentDir)) { |
Comment on lines
12
to
+19
| /** | ||
| * Clean up the conda cache directory | ||
| * Clean up extracted packages from the conda packages directory, keeping only | ||
| * the compressed archive cache and loose archive files. | ||
| * | ||
| * Instead of recursively deleting each extracted folder (extremely slow on | ||
| * Windows due to filesystem overhead), we rename them to a sibling directory | ||
| * on the same filesystem. On self-hosted (persistent) runners, stash | ||
| * directories from previous runs are cleaned up before new ones are created. |
Comment on lines
+856
to
+861
| If your environment does not allow modifications to `~/.profile` or `~/.bashrc` | ||
| (e.g. corporate self-hosted runners with restricted home directories), set | ||
| `remove-profiles: "false"` to prevent the action from deleting existing profile | ||
| files. Note that `conda init` will still append conda initialization to your | ||
| shell profiles — if even that is not allowed, you can source conda's shell | ||
| integration manually in each step instead of relying on `shell: bash -el {0}`: |
Comment on lines
+875
to
+881
| - name: Append activation to conda's init script | ||
| shell: bash | ||
| run: echo "conda activate myenv" >> $CONDA/etc/profile.d/conda.sh | ||
| - name: Run with conda | ||
| shell: bash | ||
| run: | | ||
| source $CONDA/etc/profile.d/conda.sh |
Comment on lines
+905
to
+906
| echo "source $CONDA/etc/profile.d/conda.sh" > $BASH_ENV | ||
| echo "conda activate myenv" >> $BASH_ENV |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #376