From ea8b69c3cdb649b1b8a9d9762a8f4d0537950fef Mon Sep 17 00:00:00 2001 From: Daniel Kennedy Date: Thu, 29 Jan 2026 12:47:52 -0500 Subject: [PATCH] Update the fixture to ESM syntax --- packages/cache/__tests__/__fixtures__/action.yml | 2 +- packages/cache/__tests__/__fixtures__/index.js | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/cache/__tests__/__fixtures__/action.yml b/packages/cache/__tests__/__fixtures__/action.yml index 7cd98502..a932e01b 100644 --- a/packages/cache/__tests__/__fixtures__/action.yml +++ b/packages/cache/__tests__/__fixtures__/action.yml @@ -1,5 +1,5 @@ name: 'Set env variables' description: 'Sets certain env variables so that e2e restore and save cache can be tested in a shell' runs: - using: 'node12' + using: 'node20' main: 'index.js' \ No newline at end of file diff --git a/packages/cache/__tests__/__fixtures__/index.js b/packages/cache/__tests__/__fixtures__/index.js index d5e28c0e..6ffdf760 100644 --- a/packages/cache/__tests__/__fixtures__/index.js +++ b/packages/cache/__tests__/__fixtures__/index.js @@ -1,8 +1,9 @@ // Certain env variables are not set by default in a shell context and are only available in a node context from a running action // In order to be able to restore and save cache e2e in a shell when running CI tests, we need these env variables set -const fs = require('fs'); -const os = require('os'); -const filePath = process.env[`GITHUB_ENV`] +import fs from 'fs' +import os from 'os' + +const filePath = process.env['GITHUB_ENV'] fs.appendFileSync(filePath, `ACTIONS_CACHE_SERVICE_V2=true${os.EOL}`, { encoding: 'utf8' })