This commit is contained in:
Salman Muin Kayser Chishti
2025-09-04 15:24:57 +01:00
parent b738f10ef3
commit 48e42b1fdd
5 changed files with 17 additions and 16 deletions
+2 -2
View File
@@ -31,8 +31,8 @@ export const writeAttestation = async (
headers: options.headers, headers: options.headers,
bundle: attestation as { bundle: attestation as {
mediaType?: string mediaType?: string
verificationMaterial?: { [key: string]: unknown } verificationMaterial?: {[key: string]: unknown}
dsseEnvelope?: { [key: string]: unknown } dsseEnvelope?: {[key: string]: unknown}
} }
}) })
+3 -1
View File
@@ -244,7 +244,9 @@ test('save with server error should fail', async () => {
// Mock the FinalizeCacheEntryUpload to succeed (since the error should happen in saveCache) // Mock the FinalizeCacheEntryUpload to succeed (since the error should happen in saveCache)
jest jest
.spyOn(CacheServiceClientJSON.prototype, 'FinalizeCacheEntryUpload') .spyOn(CacheServiceClientJSON.prototype, 'FinalizeCacheEntryUpload')
.mockReturnValue(Promise.resolve({ok: true, entryId: '4', message: 'Success'})) .mockReturnValue(
Promise.resolve({ok: true, entryId: '4', message: 'Success'})
)
const createTarMock = jest.spyOn(tar, 'createTar') const createTarMock = jest.spyOn(tar, 'createTar')
+2 -2
View File
@@ -76,8 +76,8 @@ export async function getDetails(): Promise<{
...(await (isWindows ...(await (isWindows
? getWindowsInfo() ? getWindowsInfo()
: isMacOS : isMacOS
? getMacOsInfo() ? getMacOsInfo()
: getLinuxInfo())), : getLinuxInfo())),
platform, platform,
arch, arch,
isWindows, isWindows,
+1 -1
View File
@@ -15,7 +15,7 @@ export async function hashFiles(
let hasMatch = false let hasMatch = false
const githubWorkspace = currentWorkspace const githubWorkspace = currentWorkspace
? currentWorkspace ? currentWorkspace
: process.env['GITHUB_WORKSPACE'] ?? process.cwd() : (process.env['GITHUB_WORKSPACE'] ?? process.cwd())
const result = crypto.createHash('sha256') const result = crypto.createHash('sha256')
let count = 0 let count = 0
for await (const file of globber.globGenerator()) { for await (const file of globber.globGenerator()) {
+9 -10
View File
@@ -646,7 +646,9 @@ describe('rmRF', () => {
// Node.js 24 changed behavior - fs.readlink no longer includes trailing backslash // Node.js 24 changed behavior - fs.readlink no longer includes trailing backslash
// Accept both formats for compatibility // Accept both formats for compatibility
const linkPath = await fs.readlink(symlinkLevel2Directory) const linkPath = await fs.readlink(symlinkLevel2Directory)
expect(linkPath.replace(/\\+$/, '')).toBe(symlinkDirectory.replace(/\\+$/, '')) expect(linkPath.replace(/\\+$/, '')).toBe(
symlinkDirectory.replace(/\\+$/, '')
)
} else { } else {
expect(await fs.readlink(symlinkLevel2Directory)).toBe(symlinkDirectory) expect(await fs.readlink(symlinkLevel2Directory)).toBe(symlinkDirectory)
} }
@@ -1202,9 +1204,8 @@ describe('which', () => {
const originalPath = process.env['PATH'] const originalPath = process.env['PATH']
try { try {
// modify PATH // modify PATH
process.env[ process.env['PATH'] =
'PATH' `${process.env['PATH']}${path.delimiter}${testPath}`
] = `${process.env['PATH']}${path.delimiter}${testPath}`
// find each file // find each file
for (const fileName of Object.keys(files)) { for (const fileName of Object.keys(files)) {
@@ -1275,9 +1276,8 @@ describe('which', () => {
await fs.writeFile(notExpectedFilePath, '') await fs.writeFile(notExpectedFilePath, '')
const originalPath = process.env['PATH'] const originalPath = process.env['PATH']
try { try {
process.env[ process.env['PATH'] =
'PATH' `${process.env['PATH']}${path.delimiter}${testPath}`
] = `${process.env['PATH']}${path.delimiter}${testPath}`
expect(await io.which(fileName)).toBe(expectedFilePath) expect(await io.which(fileName)).toBe(expectedFilePath)
} finally { } finally {
process.env['PATH'] = originalPath process.env['PATH'] = originalPath
@@ -1439,9 +1439,8 @@ describe('findInPath', () => {
try { try {
// update the PATH // update the PATH
for (const testPath of testPaths) { for (const testPath of testPaths) {
process.env[ process.env['PATH'] =
'PATH' `${process.env['PATH']}${path.delimiter}${testPath}`
] = `${process.env['PATH']}${path.delimiter}${testPath}`
} }
// exact file names // exact file names
expect(await io.findInPath(fileName)).toEqual(filePaths) expect(await io.findInPath(fileName)).toEqual(filePaths)