Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ name: Tests

on:
push:
branches: [main]
branches: [main, v1.x]
tags: ['*']
pull_request:
branches: [main]
branches: [main, v1.x]
workflow_dispatch:

permissions:
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
## [1.1.44](https://github.com/SocketDev/socket-cli/releases/tag/v1.1.43) - 2025-12-09

### Changed
- Updated the Coana CLI to v `14.12.118`.

## [1.1.43](https://github.com/SocketDev/socket-cli/releases/tag/v1.1.43) - 2025-12-08

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "socket",
"version": "1.1.43",
"version": "1.1.44",
"description": "CLI for Socket.dev",
"homepage": "https://github.com/SocketDev/socket-cli",
"license": "MIT AND OFL-1.1",
Expand Down Expand Up @@ -94,7 +94,7 @@
"@babel/preset-typescript": "7.27.1",
"@babel/runtime": "7.28.4",
"@biomejs/biome": "2.2.4",
"@coana-tech/cli": "14.12.113",
"@coana-tech/cli": "14.12.118",
"@cyclonedx/cdxgen": "11.11.0",
"@dotenvx/dotenvx": "1.49.0",
"@eslint/compat": "1.3.2",
Expand Down
10 changes: 5 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion socket.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: 2

projectIgnorePaths:
- "test/fixtures/commands/fix"
- "test/fixtures/"
14 changes: 11 additions & 3 deletions src/commands/fix/cmd-fix.e2e.test.mts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { randomUUID } from 'node:crypto'
import { existsSync, promises as fs } from 'node:fs'
import { tmpdir } from 'node:os'
import path from 'node:path'

import { describe, expect } from 'vitest'
Expand All @@ -9,6 +11,7 @@ import { cmdit, spawnSocketCli, testPath } from '../../../test/utils.mts'
import constants, { FLAG_ID } from '../../constants.mts'

const fixtureBaseDir = path.join(testPath, 'fixtures/commands/fix')
const systemTmpDir = tmpdir()

/**
* Get environment variables for E2E test subprocess.
Expand All @@ -30,24 +33,29 @@ function getTestEnv(apiToken: string): Record<string, string | undefined> {
/**
* Create a temporary copy of a fixture directory for testing.
* This allows tests to modify the fixture without affecting the original.
* Uses system temp directory with a unique identifier.
*/
async function createTempFixtureCopy(
fixtureName: string,
): Promise<{ path: string; cleanup: () => Promise<void> }> {
): Promise<{ cleanup: () => Promise<void>; path: string }> {
const sourceDir = path.join(fixtureBaseDir, fixtureName)
const tempDir = path.join(fixtureBaseDir, `${fixtureName}-temp-${Date.now()}`)
const uniqueId = randomUUID()
const tempDir = path.join(
systemTmpDir,
`socket-cli-e2e-${fixtureName}-${uniqueId}`,
)

await fs.cp(sourceDir, tempDir, { recursive: true })

return {
path: tempDir,
cleanup: async () => {
try {
await fs.rm(tempDir, { force: true, recursive: true })
} catch (e) {
logger.warn(`Failed to clean up temp dir ${tempDir}:`, e)
}
},
path: tempDir,
}
}

Expand Down
26 changes: 13 additions & 13 deletions src/commands/scan/cmd-scan-create.test.mts
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ describe('socket scan create', async () => {
'create',
FLAG_ORG,
'fakeOrg',
'test/fixtures/commands/scan/reach',
'test/fixtures/commands/scan/simple-npm',
FLAG_DRY_RUN,
'--repo',
'xyz',
Expand Down Expand Up @@ -371,7 +371,7 @@ describe('socket scan create', async () => {
'create',
FLAG_ORG,
'fakeOrg',
'test/fixtures/commands/scan/reach',
'test/fixtures/commands/scan/simple-npm',
FLAG_DRY_RUN,
'--repo',
'xyz',
Expand Down Expand Up @@ -406,7 +406,7 @@ describe('socket scan create', async () => {
'create',
FLAG_ORG,
'fakeOrg',
'test/fixtures/commands/scan/reach',
'test/fixtures/commands/scan/simple-npm',
FLAG_DRY_RUN,
'--repo',
'xyz',
Expand Down Expand Up @@ -435,7 +435,7 @@ describe('socket scan create', async () => {
'create',
FLAG_ORG,
'fakeOrg',
'test/fixtures/commands/scan/reach',
'test/fixtures/commands/scan/simple-npm',
FLAG_DRY_RUN,
'--repo',
'xyz',
Expand Down Expand Up @@ -528,7 +528,7 @@ describe('socket scan create', async () => {
'create',
FLAG_ORG,
'fakeOrg',
'test/fixtures/commands/scan/reach',
'test/fixtures/commands/scan/simple-npm',
FLAG_DRY_RUN,
'--repo',
'xyz',
Expand Down Expand Up @@ -596,7 +596,7 @@ describe('socket scan create', async () => {
'create',
FLAG_ORG,
'fakeOrg',
'test/fixtures/commands/scan/reach',
'test/fixtures/commands/scan/simple-npm',
FLAG_DRY_RUN,
'--repo',
'xyz',
Expand All @@ -622,7 +622,7 @@ describe('socket scan create', async () => {
'create',
FLAG_ORG,
'fakeOrg',
'test/fixtures/commands/scan/reach',
'test/fixtures/commands/scan/simple-npm',
FLAG_DRY_RUN,
'--repo',
'xyz',
Expand All @@ -648,7 +648,7 @@ describe('socket scan create', async () => {
'create',
FLAG_ORG,
'fakeOrg',
'test/fixtures/commands/scan/reach',
'test/fixtures/commands/scan/simple-npm',
FLAG_DRY_RUN,
'--repo',
'xyz',
Expand Down Expand Up @@ -678,7 +678,7 @@ describe('socket scan create', async () => {
'create',
FLAG_ORG,
'fakeOrg',
'test/fixtures/commands/scan/reach',
'test/fixtures/commands/scan/simple-npm',
FLAG_DRY_RUN,
'--repo',
'xyz',
Expand Down Expand Up @@ -711,7 +711,7 @@ describe('socket scan create', async () => {
'create',
FLAG_ORG,
'fakeOrg',
'test/fixtures/commands/scan/reach',
'test/fixtures/commands/scan/simple-npm',
FLAG_DRY_RUN,
'--repo',
'xyz',
Expand All @@ -736,7 +736,7 @@ describe('socket scan create', async () => {
'create',
FLAG_ORG,
'fakeOrg',
'test/fixtures/commands/scan/reach',
'test/fixtures/commands/scan/simple-npm',
FLAG_DRY_RUN,
'--repo',
'xyz',
Expand All @@ -761,7 +761,7 @@ describe('socket scan create', async () => {
'create',
FLAG_ORG,
'fakeOrg',
'test/fixtures/commands/scan/reach',
'test/fixtures/commands/scan/simple-npm',
FLAG_DRY_RUN,
'--repo',
'xyz',
Expand Down Expand Up @@ -791,7 +791,7 @@ describe('socket scan create', async () => {
'create',
FLAG_ORG,
'fakeOrg',
'test/fixtures/commands/scan/reach',
'test/fixtures/commands/scan/simple-npm',
FLAG_DRY_RUN,
'--repo',
'xyz',
Expand Down
Loading