From 8fa3c6c894e4dec598cbfe23266052affa5ffef2 Mon Sep 17 00:00:00 2001 From: 1138-4EB <1138-4EB@users.noreply.github.com> Date: Wed, 23 Oct 2019 04:01:28 +0200 Subject: [PATCH] experimental: add 'msys.cmd' to support multi-line run steps --- .github/workflows/test.yml | 13 +++++++++++++ index.js | 14 +++++++++++--- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 551656b..4bc5dce 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -72,6 +72,19 @@ jobs: env: MSYSTEM: MINGW32 + shell: + runs-on: windows-latest + steps: + - uses: actions/checkout@v1 + - name: install deps + run: npm ci + - name: run action + uses: ./ + - shell: ./msys2.cmd {0} + run: | + uname -a + pacman -Syu --noconfirm + msystem: strategy: matrix: diff --git a/index.js b/index.js index a7a73b6..4d73338 100644 --- a/index.js +++ b/index.js @@ -32,12 +32,20 @@ async function run() { let cmd = path.join(dest, 'msys2do.cmd'); fs.writeFileSync(cmd, [ - 'setlocal', - '@echo off', - 'IF NOT DEFINED MSYS2_PATH_TYPE set MSYS2_PATH_TYPE=' + core.getInput('path-type'), + `setlocal`, + `@echo off`, + `IF NOT DEFINED MSYS2_PATH_TYPE set MSYS2_PATH_TYPE=` + core.getInput('path-type'), `%~dp0\\msys64\\usr\\bin\\bash.exe -ilc "cd $OLDPWD && %*"` ].join('\r\n')); + fs.writeFileSync('C:/hostedtoolcache/windows/Python/3.6.8/x64/msys2.cmd', [ + `setlocal`, + `@echo off`, + `set "args=%*"`, + `set "args=%args:\\=/%"`, + cmd + ` %args%` + ].join('\r\n')); + core.addPath(dest); core.exportVariable('MSYSTEM', core.getInput('msystem'));