From 2867e318d4d0de11b10a2887fb29dcf713559a71 Mon Sep 17 00:00:00 2001 From: Sampark Sharma Date: Thu, 29 Dec 2022 07:44:47 +0000 Subject: [PATCH] Add env variable to enable windows symlinks --- packages/cache/__tests__/tar.test.ts | 3 +++ packages/cache/src/internal/tar.ts | 2 ++ 2 files changed, 5 insertions(+) diff --git a/packages/cache/__tests__/tar.test.ts b/packages/cache/__tests__/tar.test.ts index a33f4fab..7ae77601 100644 --- a/packages/cache/__tests__/tar.test.ts +++ b/packages/cache/__tests__/tar.test.ts @@ -1,4 +1,5 @@ import * as exec from '@actions/exec' +import {exportVariable} from '@actions/core' import * as io from '@actions/io' import * as path from 'path' import { @@ -14,6 +15,8 @@ import * as utils from '../src/internal/cacheUtils' // eslint-disable-next-line @typescript-eslint/no-require-imports import fs = require('fs') +exportVariable('MSYS', 'winsymlinks:nativestrict') + jest.mock('@actions/exec') jest.mock('@actions/io') diff --git a/packages/cache/src/internal/tar.ts b/packages/cache/src/internal/tar.ts index 0af6a87a..8c6337e6 100644 --- a/packages/cache/src/internal/tar.ts +++ b/packages/cache/src/internal/tar.ts @@ -1,4 +1,5 @@ import {exec} from '@actions/exec' +import {exportVariable} from '@actions/core' import * as io from '@actions/io' import {existsSync, writeFileSync} from 'fs' import * as path from 'path' @@ -13,6 +14,7 @@ import { } from './constants' const IS_WINDOWS = process.platform === 'win32' +exportVariable('MSYS', 'winsymlinks:nativestrict') // Returns tar path and type: BSD or GNU async function getTarPath(): Promise {