aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/action.yml
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2021-03-14 03:42:14 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2021-03-14 03:42:14 +0300
commit203b15ee12f9b6f18de4f6575873d698be313557 (patch)
treecd8b9209042139c325aa142864e45ad20f52597c /action.yml
parentadd .gitattributes (diff)
downloadcleanup-path-203b15ee12f9b6f18de4f6575873d698be313557.tar.gz
cleanup-path-203b15ee12f9b6f18de4f6575873d698be313557.zip
make it into a JavaScript action
This is a huge step back IMO, but I needed to be able to restore the original PATH back as a "post" step. Currently, composite actions don't support post-actions, but JavaScript ones do. I needed this due to a bug: actions/cache wouldn't find Git's tar on windows-2016 (the one in System32 would get used on windows-2019) if the PATH was cleaned up.
Diffstat (limited to '')
-rw-r--r--action.yml35
1 files changed, 3 insertions, 32 deletions
diff --git a/action.yml b/action.yml
index d83e0c5..8f3388d 100644
--- a/action.yml
+++ b/action.yml
@@ -11,38 +11,9 @@ inputs:
default: 1
runs:
- using: composite
- steps:
- - run: |
- New-Variable os -Value ('${{ runner.os }}') -Option Constant
-
- New-Variable windows_host -Value ($os -eq 'Windows') -Option Constant
-
- New-Variable dirs -Value ('${{ inputs.dirs }}') -Option Constant
- New-Variable default -Value ('${{ inputs.default }}' -eq '1') -Option Constant
-
- if ($windows_host) {
- $sep = [IO.Path]::PathSeparator
-
- $new_path = $dirs.Split($sep, [System.StringSplitOptions]::RemoveEmptyEntries)
-
- if ($default) {
- # This seems to be the default on new installations.
- # Also, MSYS2 does this.
- $new_path += @(
- 'C:\Windows\system32',
- 'C:\Windows',
- 'C:\Windows\System32\Wbem',
- 'C:\Windows\System32\WindowsPowerShell\v1.0\'
- )
- }
-
- $new_path = $new_path -join $sep
- echo "PATH=$new_path" >> $env:GITHUB_ENV
- } else {
- echo "::warning ::Not going to clean up PATH variable on $os"
- }
- shell: pwsh
+ using: node12
+ main: clean.js
+ post: restore.js
branding:
icon: star