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
49 changes: 49 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: CI

on:
push:
branches: [main, v1.x]
pull_request:
branches: [main, v1.x]

permissions:
contents: read

jobs:
lint:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: SocketDev/socket-registry/.github/actions/setup-and-install@51be85d39d3b4a42dd9d4712948b9d30a2e04794
with:
node-version: 22

- name: Lint
run: pnpm check:lint

typecheck:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: SocketDev/socket-registry/.github/actions/setup-and-install@51be85d39d3b4a42dd9d4712948b9d30a2e04794
with:
node-version: 22

- name: Type check
run: pnpm check:tsc

test:
runs-on: ${{ matrix.os }}
timeout-minutes: 15
strategy:
fail-fast: true
matrix:
node-version: [20, 22, 24]
os: [ubuntu-latest]
steps:
- uses: SocketDev/socket-registry/.github/actions/setup-and-install@51be85d39d3b4a42dd9d4712948b9d30a2e04794
with:
node-version: ${{ matrix.node-version }}

- name: Build and run unit tests
run: pnpm test-ci
7 changes: 5 additions & 2 deletions src/commands/fix/branch-cleanup.integration.test.mts
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,12 @@ describe('branch-cleanup integration tests', () => {
remoteDir = path.join(tempDir, 'remote.git')
repoDir = path.join(tempDir, 'repo')

// Initialize bare remote repository.
// Initialize bare remote repository with main as default branch.
await fs.mkdir(remoteDir, { recursive: true })
await spawn('git', ['init', '--bare'], { cwd: remoteDir, stdio: 'ignore' })
await spawn('git', ['init', '--bare', '--initial-branch', 'main'], {
cwd: remoteDir,
stdio: 'ignore',
})

// Clone the remote to create local repository.
await spawn('git', ['clone', remoteDir, repoDir], {
Expand Down
1 change: 1 addition & 0 deletions src/commands/fix/cmd-fix.integration.test.mts
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ describe('socket fix', async () => {
--autopilot Enable auto-merge for pull requests that Socket opens.
See GitHub documentation (https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-auto-merge-for-pull-requests-in-your-repository) for managing auto-merge for pull requests in your repository.
--debug Enable debug logging in the Coana-based Socket Fix CLI invocation.
--disable-external-tool-checks Disable external tool checks during fix analysis.
--ecosystems Limit fix analysis to specific ecosystems. Can be provided as comma separated values or as multiple flags. Defaults to all ecosystems.
--exclude Exclude workspaces matching these glob patterns. Can be provided as comma separated values or as multiple flags
--fix-version Override the version of @coana-tech/cli used for fix analysis. Default: <coana-version>.
Expand Down
4 changes: 2 additions & 2 deletions src/commands/fix/handle-fix-limit.test.mts
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ describe('socket fix --pr-limit behavior verification', () => {
})

expect(result.ok).toBe(true)
expect(result.data?.fixed).toBe(false)
expect(result.data?.fixedAll).toBe(false)

// Only discovery call, no fix call since no GHSAs found.
expect(mockSpawnCoanaDlx).toHaveBeenCalledTimes(1)
Expand Down Expand Up @@ -374,7 +374,7 @@ describe('socket fix --pr-limit behavior verification', () => {
})

expect(result.ok).toBe(true)
expect(result.data?.fixed).toBe(false)
expect(result.data?.fixedAll).toBe(false)

// With 5 open PRs and prLimit 3, adjusted limit is 0, so no processing.
expect(mockSpawnCoanaDlx).not.toHaveBeenCalled()
Expand Down
1 change: 1 addition & 0 deletions src/commands/scan/cmd-scan-create.test.mts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ describe('socket scan create', async () => {
--reach-debug Enable debug mode for reachability analysis. Provides verbose logging from the reachability CLI.
--reach-detailed-analysis-log-file A log file with detailed analysis logs is written to root of each analyzed workspace.
--reach-disable-analytics Disable reachability analytics sharing with Socket. Also disables caching-based optimizations.
--reach-disable-external-tool-checks Disable external tool checks during reachability analysis.
--reach-ecosystems List of ecosystems to conduct reachability analysis on, as either a comma separated value or as multiple flags. Defaults to all ecosystems.
--reach-enable-analysis-splitting Allow the reachability analysis to partition CVEs into buckets that are processed in separate analysis runs. May improve accuracy, but not recommended by default.
--reach-exclude-paths List of paths to exclude from reachability analysis, as either a comma separated value or as multiple flags.
Expand Down
1 change: 1 addition & 0 deletions src/commands/scan/cmd-scan-reach.test.mts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ describe('socket scan reach', async () => {
--reach-debug Enable debug mode for reachability analysis. Provides verbose logging from the reachability CLI.
--reach-detailed-analysis-log-file A log file with detailed analysis logs is written to root of each analyzed workspace.
--reach-disable-analytics Disable reachability analytics sharing with Socket. Also disables caching-based optimizations.
--reach-disable-external-tool-checks Disable external tool checks during reachability analysis.
--reach-ecosystems List of ecosystems to conduct reachability analysis on, as either a comma separated value or as multiple flags. Defaults to all ecosystems.
--reach-enable-analysis-splitting Allow the reachability analysis to partition CVEs into buckets that are processed in separate analysis runs. May improve accuracy, but not recommended by default.
--reach-exclude-paths List of paths to exclude from reachability analysis, as either a comma separated value or as multiple flags.
Expand Down
Loading