https://github.com/egor-tensin/cleanup-path
GitHub action to clean up your PATH
https://github.com/egor-tensin/cleanup-path
action github-actions
Last synced: 3 months ago
JSON representation
GitHub action to clean up your PATH
- Host: GitHub
- URL: https://github.com/egor-tensin/cleanup-path
- Owner: egor-tensin
- License: mit
- Created: 2020-12-23T23:38:00.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-04-04T17:11:40.000Z (over 1 year ago)
- Last Synced: 2025-05-29T13:11:47.013Z (4 months ago)
- Topics: action, github-actions
- Language: JavaScript
- Homepage:
- Size: 470 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
Clean up PATH
=============[](https://github.com/egor-tensin/cleanup-path/actions/workflows/test.yml)
This GitHub action cleans up the PATH variable.
The PATH variable on Windows runners is a cesspool.
For example, it includes seemingly dozens of MinGW distributions.
This action takes a page out of MSYS2's book here, and cleans PATH so that only
the default paths are included.Use it in your workflow like this:
- name: Clean up PATH
uses: egor-tensin/cleanup-path@v4* You can pass additional directory paths to add to PATH using the `dirs`
parameter.
* System directories under C:\Windows are added to PATH by default.
Disable this by setting the `default` parameter to `0`.API
---| Input | Value | Default | Description
| ------- | ------- | ------- | -----------
| dirs | *empty* | ✓ | No additional paths.
| | *any* | | Additional paths, separated by a semicolon (;).
| default | 1 | ✓ | Add the default directories under C:\Windows.
| | *any* | | Don't add the default directories.The action sets the PATH environment variable.
Notes
-----* Even if you call the action with `default: 0` and don't specify any `dirs`,
it might not clear your PATH completely.
Actions like `setup-python`, etc. seem to have a way to propagate their values
to PATH regardless.
Also, your `shell` selection matters.
* v1 of this action is a simple composite action with the same API.
At some point, it turned out that restoring PATH value might be desirable in
the action's `post` stage.
In particular, the GitHub-provided `cache` action wasn't able to find the `tar`
executable on windows-2016 images (windows-2019 images have it built-in under
C:\Windows).
Composite actions don't support having the `post` stage, so it became a
JavaScript action.License
-------Distributed under the MIT License.
See [LICENSE.txt] for details.[LICENSE.txt]: LICENSE.txt