Skip to content
Open
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
1 change: 0 additions & 1 deletion .config/vitest.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ export default {
// contain full repo copies populated by `socket optimize` runs; their .test.mts
// files would otherwise be globbed and run as if they were the real suite.
'test/fixtures/**',
'test/fleet/**',
'upstream/**',
],
coverage: {
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ jobs:

- name: Restore pinned SEA download cache
id: sea-download-cache
uses: ./.github/actions/repo/cache-downloads
uses: ./.github/actions/cache-downloads
with:
mode: restore
path: ~/.cache/socket-sea/downloads/v1/blobs
Expand Down Expand Up @@ -472,7 +472,7 @@ jobs:

- name: Save pinned SEA download cache
if: success() && steps.sea-download-cache.outputs.cache-hit != 'true' && github.repository == 'SocketDev/socket-cli' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && (github.ref == 'refs/heads/v1.x' || github.ref == 'refs/heads/feat/v1x-node27-sea-vfs-socket' || startsWith(github.ref, 'refs/heads/test/native-terminal-validation-'))
uses: ./.github/actions/repo/cache-downloads
uses: ./.github/actions/cache-downloads
with:
mode: save
path: ~/.cache/socket-sea/downloads/v1/blobs
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/publish-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ jobs:
- name: Upload verified tarballs
if: steps.release-meta.outputs.version != ''
id: upload
uses: ./.github/actions/repo/upload-artifact
uses: ./.github/actions/upload-artifact
with:
name: npm-release-tarballs-${{ github.run_attempt }}
path: ${{ runner.temp }}/dist
Expand All @@ -345,7 +345,7 @@ jobs:
- name: Upload verified launcher
if: steps.native-meta.outputs.version != ''
id: upload-native
uses: ./.github/actions/repo/upload-artifact
uses: ./.github/actions/upload-artifact
with:
name: npm-native-launcher-${{ github.run_attempt }}
path: ${{ runner.temp }}/launcher
Expand Down Expand Up @@ -434,7 +434,7 @@ jobs:

- name: Upload tested platform package
id: upload
uses: ./.github/actions/repo/upload-artifact
uses: ./.github/actions/upload-artifact
with:
name: native-${{ matrix.target }}-${{ github.run_attempt }}
path: ${{ runner.temp }}/platform
Expand Down Expand Up @@ -713,7 +713,7 @@ jobs:
- name: Upload the prepared release patch
if: ${{ inputs.dry-run == false }}
id: patch
uses: ./.github/actions/repo/upload-artifact
uses: ./.github/actions/upload-artifact
with:
name: release-bump-${{ github.run_attempt }}
path: ${{ runner.temp }}/release-bump
Expand Down
30 changes: 12 additions & 18 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,14 @@
!/.vscode/
!/.github/
!/.github/actions/
!/.github/actions/repo/
!/.github/actions/repo/cache-downloads/
!/.github/actions/repo/upload-artifact/
!/.github/actions/cache-downloads/
!/.github/actions/upload-artifact/
!/.github/scripts/
!/.github/workflows/
!/.github/actions/repo/upload-artifact/action.yml
!/.github/actions/repo/upload-artifact/index.mjs
!/.github/actions/repo/cache-downloads/action.yml
!/.github/actions/repo/cache-downloads/index.mts
!/.github/actions/upload-artifact/action.yml
!/.github/actions/upload-artifact/index.mjs
!/.github/actions/cache-downloads/action.yml
!/.github/actions/cache-downloads/index.mts
!/.github/scripts/download-release-artifacts.mts
!/.github/scripts/pin-readme-assets.mjs
!/.github/scripts/smoke-test-tarball.mts
Expand All @@ -28,7 +27,6 @@
!/.github/workflows/publish-npm.yml
!/.github/workflows/release-github.yml
!/assets/
!/assets/fleet/
!/bin/
!/docs/
!/docs/commands/
Expand Down Expand Up @@ -137,9 +135,8 @@
!/test/unit/
!/test/unit/github/
!/test/unit/github/actions/
!/test/unit/github/actions/repo/
!/test/unit/github/actions/repo/cache-downloads/
!/test/unit/github/actions/repo/cache-downloads/index.test.mts
!/test/unit/github/actions/cache-downloads/
!/test/unit/github/actions/cache-downloads/index.test.mts
!/test/unit/constants.test.mts
!/test/unit/sea/
!/test/unit/sea/build/
Expand Down Expand Up @@ -272,10 +269,10 @@
!/DISCLOSURE
!/LICENSE
!/README.md
!/assets/fleet/badge-follow-bluesky.svg
!/assets/fleet/badge-follow-x.svg
!/assets/fleet/socket-combomark-dark.svg
!/assets/fleet/socket-combomark-light.svg
!/assets/badge-follow-bluesky.svg
!/assets/badge-follow-x.svg
!/assets/socket-combomark-dark.svg
!/assets/socket-combomark-light.svg
!/bin/cli.js
!/bin/npm-cli.js
!/bin/npx-cli.js
Expand Down Expand Up @@ -989,9 +986,6 @@
*.tsbuildinfo
/.repo-map/
/upstream/
/docs/fleet/
/scripts/fleet/
/test/fleet/
/.claude/ops/
/.claude/worktrees/
/.github/copilot-instructions.md
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<!-- coverage-badge:start -->
[![Coverage](https://img.shields.io/badge/coverage-95%25-brightgreen)](https://github.com/SocketDev/socket-cli/actions)
<!-- coverage-badge:end -->
[![Follow @SocketSecurity](assets/fleet/badge-follow-x.svg)](https://twitter.com/SocketSecurity)
[![Follow @socket.dev on Bluesky](assets/fleet/badge-follow-bluesky.svg)](https://bsky.app/profile/socket.dev)
[![Follow @SocketSecurity](assets/badge-follow-x.svg)](https://twitter.com/SocketSecurity)
[![Follow @socket.dev on Bluesky](assets/badge-follow-bluesky.svg)](https://bsky.app/profile/socket.dev)

CLI for [Socket.dev](https://socket.dev) — scan dependencies, audit packages, apply security patches, and gate installs from your terminal or CI. This is the 1.x line of the published `socket` package on npm.

Expand Down Expand Up @@ -212,8 +212,8 @@ MIT
<br/>
<div align="center">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="assets/fleet/socket-combomark-dark.svg">
<source media="(prefers-color-scheme: light)" srcset="assets/fleet/socket-combomark-light.svg">
<img width="324" height="104" alt="Socket" src="assets/fleet/socket-combomark-light.svg">
<source media="(prefers-color-scheme: dark)" srcset="assets/socket-combomark-dark.svg">
<source media="(prefers-color-scheme: light)" srcset="assets/socket-combomark-light.svg">
<img width="324" height="104" alt="Socket" src="assets/socket-combomark-light.svg">
</picture>
</div>
File renamed without changes
4 changes: 2 additions & 2 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ module.exports = [
'*.config.mts',
'.config/*.config.mts',
'.config/snapshot-path.mts',
'.github/actions/repo/cache-downloads/*.mts',
'.github/actions/cache-downloads/*.mts',
// Allow paths like src/utils/*.test.mts.
'src/*/*.test.mts',
// Allow paths like src/commands/optimize/*.test.mts.
Expand All @@ -244,7 +244,7 @@ module.exports = [
'test/e2e/*.test.mts',
'test/termless/utils/*.test.mts',
'test/unit/utils/*.test.mts',
'test/unit/github/actions/repo/cache-downloads/*.test.mts',
'test/unit/github/actions/cache-downloads/*.test.mts',
'test/lib/native/*.mts',
'test/lib/terminal/*.mts',
'test/lib/termless/*.mts',
Expand Down
4 changes: 2 additions & 2 deletions scripts/ci/check-actions.mts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export function disallowedActionReferences(document: unknown): string[] {
if (
key === 'uses' &&
typeof value === 'string' &&
!/^\.\/\.github\/actions\/repo\/[\da-z][\w.-]*(?:\/[\da-z][\w.-]*)*$/i.test(
!/^\.\/\.github\/actions\/[\da-z][\w.-]*(?:\/[\da-z][\w.-]*)*$/i.test(
value,
)
) {
Expand Down Expand Up @@ -60,7 +60,7 @@ if (isMainModule(import.meta.url)) {
process.stdout.write(`${JSON.stringify({ findings })}\n`)
} else if (findings.length) {
process.stderr.write(
`Disallowed actions or symbolic links found: ${findings.join(', ')}. Use steps under ./.github/actions/repo/ without traversal or symbolic links.\n`,
`Disallowed actions or symbolic links found: ${findings.join(', ')}. Use steps under ./.github/actions/ without traversal or symbolic links.\n`,
)
}
return findings.length ? 1 : 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
resolveBlobPath,
runCacheAction,
seaDownloadBlobPath,
} from '../../../../../../.github/actions/repo/cache-downloads/index.mts'
} from '../../../../../.github/actions/cache-downloads/index.mts'

const reporter = () => ({
warning: vi.fn(),
Expand Down
32 changes: 16 additions & 16 deletions test/unit/scripts/ci/check-actions.test.mts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function actionFixture(reference: string) {
directories.push(root)
const github = path.join(root, '.github')
const workflows = path.join(github, 'workflows')
const actions = path.join(github, 'actions', 'repo')
const actions = path.join(github, 'actions')
mkdirSync(workflows, { recursive: true })
mkdirSync(actions, { recursive: true })
const workflow = path.join(workflows, 'build.yml')
Expand Down Expand Up @@ -69,7 +69,7 @@ jobs:
runs:
using: composite
steps:
- uses: ./.github/actions/repo/upload-artifact
- uses: ./.github/actions/upload-artifact
- run: echo ready
`),
),
Expand All @@ -78,16 +78,16 @@ runs:

it.each([
'./scripts/actions/tool',
'./.github/actions/fleet/tool',
'./.github/actions/repo',
'./.github/actions/repo/tool/',
'./.github/actions/repo/../external',
'./.github/actions/repo/./tool',
'./.github/actions/repo/tool/../../external',
'./.github/actions/repo//tool',
'./.github/actions/repo/tool\\external',
'./.github/actions/repo/%2e%2e/external',
'./.github/actions/repo/tool@revision',
'./.github/workflows/tool',
'./.github/actions',
'./.github/actions/tool/',
'./.github/actions/../external',
'./.github/actions/./tool',
'./.github/actions/tool/../../external',
'./.github/actions//tool',
'./.github/actions/tool\\external',
'./.github/actions/%2e%2e/external',
'./.github/actions/tool@revision',
])(
'rejects a local action outside the permitted path syntax: %s',
reference => {
Expand All @@ -99,7 +99,7 @@ runs:
)

it('accepts nested repository action directories and inspects their definitions', () => {
const fixture = actionFixture('./.github/actions/repo/build/tool')
const fixture = actionFixture('./.github/actions/build/tool')
const directory = path.join(fixture.actions, 'build', 'tool')
mkdirSync(directory, { recursive: true })
const action = path.join(directory, 'action.yml')
Expand All @@ -118,7 +118,7 @@ runs:
})

it('rejects a linked action directory without following it', () => {
const fixture = actionFixture('./.github/actions/repo/linked')
const fixture = actionFixture('./.github/actions/linked')
const outside = path.join(fixture.root, 'external-action')
mkdirSync(outside)
writeFileSync(
Expand All @@ -133,7 +133,7 @@ runs:
})

it('rejects linked action files and broken links', () => {
const fixture = actionFixture('./.github/actions/repo/linked')
const fixture = actionFixture('./.github/actions/linked')
const directory = path.join(fixture.actions, 'linked')
mkdirSync(directory)
const linked = path.join(directory, 'action.yml')
Expand All @@ -144,7 +144,7 @@ runs:
})

it('rejects a linked scan root', () => {
const fixture = actionFixture('./.github/actions/repo/tool')
const fixture = actionFixture('./.github/actions/tool')
const linked = path.join(fixture.root, 'linked-github')
symlinkSync(fixture.github, linked, 'dir')
const findings = checkWorkflowActions(linked)
Expand Down
Loading