diff --git a/__tests__/cache.test.ts b/__tests__/cache.test.ts index 0457e4d..75a6fa5 100644 --- a/__tests__/cache.test.ts +++ b/__tests__/cache.test.ts @@ -12,7 +12,7 @@ jest.mock('../src/cache', () => ({ const script_path = 'extensions.sh'; return ( - 'bash ' + script_path + ' "' + extensions + '-' + key + '" ' + version + 'bash ' + script_path + ' "' + extensions + '" ' + key + ' ' + version ); } ) @@ -42,13 +42,13 @@ describe('Install', () => { setEnv('7.0', 'xdebug, pcov', 'cache-v1'); // @ts-ignore const script: string = await install.run(); - expect(script).toContain('bash extensions.sh "xdebug, pcov-cache-v1" 7.0'); + expect(script).toContain('bash extensions.sh "xdebug, pcov" cache-v1 7.0'); }); it('Test Run', async () => { setEnv('7.4', 'xdebug, zip', 'cache-v2'); // @ts-ignore const script: string = await install.run(); - expect(script).toContain('bash extensions.sh "xdebug, zip-cache-v2" 7.4'); + expect(script).toContain('bash extensions.sh "xdebug, zip" cache-v2 7.4'); }); }); diff --git a/dist/index.js b/dist/index.js index 8a7c235..5e9c901 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1555,7 +1555,7 @@ function run() { const extensions = yield utils.getInput('extensions', true); const key = yield utils.getInput('key', true); const script_path = path.join(__dirname, '../src/extensions.sh'); - yield exec_1.exec('bash ' + script_path + ' "' + extensions + '-' + key + '" ' + version); + yield exec_1.exec('bash ' + script_path + ' "' + extensions + '" ' + key + ' ' + version); } catch (error) { core.setFailed(error.message); diff --git a/src/cache.ts b/src/cache.ts index 5b7522a..d1bcaad 100644 --- a/src/cache.ts +++ b/src/cache.ts @@ -14,7 +14,7 @@ export async function run(): Promise { const key: string = await utils.getInput('key', true); const script_path: string = path.join(__dirname, '../src/extensions.sh'); await exec( - 'bash ' + script_path + ' "' + extensions + '-' + key + '" ' + version + 'bash ' + script_path + ' "' + extensions + '" ' + key + ' ' + version ); } catch (error) { core.setFailed(error.message); diff --git a/src/extensions.sh b/src/extensions.sh index f3c8394..2b7384f 100644 --- a/src/extensions.sh +++ b/src/extensions.sh @@ -44,8 +44,9 @@ get_apiv() { esac } -version=$2 extensions=$1 +key=$2 +version=$3 os=$(uname -s) if [ "$os" = "Linux" ]; then flags='-Po' @@ -68,6 +69,6 @@ else os="Windows" dir='C:\\tools\\php\\ext' fi -key="$os"-ext-"$version"-$(echo -n "$extensions" | openssl dgst -sha256 | cut -d ' ' -f 2) +key="$os"-ext-"$version"-$(echo -n "$extensions-$key" | openssl dgst -sha256 | cut -d ' ' -f 2) echo "::set-output name=dir::$dir" echo "::set-output name=key::$key" \ No newline at end of file