Skip to content

Commit 925ad5e

Browse files
committed
Merge origin/v1.x into facts branch; cut 1.1.114
Resolve conflicts: - package.json / pnpm-lock.yaml: take @coana-tech/cli 15.3.20 from v1.x. - CHANGELOG.md: fold the facts-by-default changes into a new 1.1.114 section and keep v1.x's released 1.1.113 (Bazel + Coana 15.3.20) intact, dropping the duplicate 1.1.113 our branch had cut locally. - Bump socket-cli to 1.1.114.
2 parents d1a8808 + d93f9be commit 925ad5e

35 files changed

Lines changed: 4086 additions & 2035 deletions

.github/workflows/provenance.yml

Lines changed: 69 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,15 @@ jobs:
2626
runs-on: ubuntu-latest
2727

2828
permissions:
29-
contents: read
29+
# `contents: write` needed to create the v<version> tag via gh api
30+
# at the end of this job. Token is scoped to the dedicated tag step
31+
# via GH_TOKEN env; never persisted in `.git/config` (checkout keeps
32+
# persist-credentials: false so build/install steps can't reach it).
33+
contents: write
3034
id-token: write # NPM trusted publishing via OIDC
3135

3236
steps:
33-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
37+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 (2026-05-20)
3438
with:
3539
persist-credentials: false
3640

@@ -201,7 +205,9 @@ jobs:
201205
run: pnpm install --loglevel error
202206

203207
- run: INLINED_SOCKET_CLI_PUBLISHED_BUILD=1 pnpm run build:dist
204-
- run: npm publish --provenance --access public --tag "${NPM_DIST_TAG}"
208+
- name: Publish socket
209+
id: publish_socket
210+
run: npm publish --provenance --access public --tag "${NPM_DIST_TAG}"
205211
continue-on-error: true
206212
env:
207213
NPM_DIST_TAG: ${{ inputs.dist-tag }}
@@ -225,3 +231,63 @@ jobs:
225231
NPM_DIST_TAG: ${{ inputs.dist-tag }}
226232
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} # zizmor: ignore[secrets-outside-env]
227233
SOCKET_CLI_DEBUG: ${{ inputs.debug }}
234+
235+
# Create v<version> git tag at the published commit SHA after a
236+
# successful socket-package publish, idempotently. GitHub Release
237+
# Immutability ("Disallow assets and tags from being modified once a
238+
# release is published") freezes tags once bound to a Release, so:
239+
# - existing tag at same SHA → no-op
240+
# - existing tag at different SHA → hard-fail (operator recovery
241+
# required)
242+
# Gated on the first publish step (publish_socket — the `socket` npm
243+
# package) actually succeeding; the cli / cli-with-sentry publishes
244+
# use `continue-on-error: true` and don't gate the tag.
245+
#
246+
# Uses gh api (not `git push`) so the token only lives in this step's
247+
# env, never written to `.git/config` by an earlier `actions/checkout`
248+
# with persist-credentials: true (which would leak it to every later
249+
# step including `pnpm install` postinstall scripts).
250+
- name: Tag release (idempotent)
251+
if: steps.publish_socket.outcome == 'success'
252+
env:
253+
GH_TOKEN: ${{ github.token }}
254+
REPO: ${{ github.repository }}
255+
run: |
256+
PUBLISHED_SHA=$(git rev-parse HEAD)
257+
PUBLISHED_VERSION=$(node -p "require('./package.json').version")
258+
TAG="v$PUBLISHED_VERSION"
259+
260+
# Look up any existing tag ref. gh api exits non-zero on 404 (tag
261+
# absent) and writes the error body to stdout, so branch on the
262+
# exit code — never on whether stdout is empty. EXISTING_JSON is
263+
# only valid JSON when the call succeeded.
264+
if EXISTING_JSON=$(gh api "repos/$REPO/git/ref/tags/$TAG" 2>/dev/null); then
265+
# The ref's object is either a commit (lightweight tag) or a tag
266+
# object (annotated/signed tag, e.g. the hand-created `git tag -s`
267+
# tags). For an annotated tag, object.sha is the tag-object SHA,
268+
# not the commit — dereference it via git/tags to get the commit
269+
# the tag actually points at before comparing.
270+
REF_TYPE=$(echo "$EXISTING_JSON" | node -p "JSON.parse(require('fs').readFileSync(0,'utf8')).object.type")
271+
REF_OBJECT_SHA=$(echo "$EXISTING_JSON" | node -p "JSON.parse(require('fs').readFileSync(0,'utf8')).object.sha")
272+
if [ "$REF_TYPE" = "tag" ]; then
273+
EXISTING_SHA=$(gh api "repos/$REPO/git/tags/$REF_OBJECT_SHA" --jq '.object.sha')
274+
else
275+
EXISTING_SHA="$REF_OBJECT_SHA"
276+
fi
277+
if [ "$EXISTING_SHA" = "$PUBLISHED_SHA" ]; then
278+
echo "Tag $TAG already exists at $PUBLISHED_SHA — no-op."
279+
exit 0
280+
fi
281+
echo "::error::Tag $TAG exists at $EXISTING_SHA but publish SHA is $PUBLISHED_SHA."
282+
echo "::error::Release immutability is enabled; this requires manual recovery:"
283+
echo "::error:: 1. Delete any GitHub Release tied to $TAG"
284+
echo "::error:: 2. Delete the tag via the API"
285+
echo "::error:: 3. Re-run this workflow"
286+
exit 1
287+
fi
288+
289+
gh api "repos/$REPO/git/refs" \
290+
-X POST \
291+
-f "ref=refs/tags/$TAG" \
292+
-f "sha=$PUBLISHED_SHA"
293+
echo "Created tag $TAG at $PUBLISHED_SHA"

CHANGELOG.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,22 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
66

7-
## [Unreleased]
8-
- **`socket manifest bazel [beta]`** — Generate Bazel JVM SBOM manifests by running `bazel query` against discovered Maven repos in a Bazel workspace. Closes the inline-Maven-declaration gap that lockfile-only parsing misses for repos like envoy, ray, tensorflow, tink-java, and or-tools. Auto-detects Bzlmod and legacy `WORKSPACE`.
9-
- **`socket scan create --auto-manifest`** now covers Bazel workspaces in addition to Gradle/Scala/Kotlin/Conda. Repos with `MODULE.bazel`, `WORKSPACE`, or `WORKSPACE.bazel` are detected automatically and their Maven dependencies extracted as part of the standard scan-create flow.
10-
- **Bazel PyPI extraction**`socket manifest bazel --ecosystem pypi` now generates `requirements.txt` for Python Bazel workspaces. Discovers custom `rules_python` pip hub names with Bazel command output first, queries `py_library` / `py_binary` / `py_test` dependencies, resolves canonical pinned versions from `requirements_lock.txt`, and emits PEP 503-normalized `name==version` lines. Supports both Bzlmod (`pip.parse`) and legacy `WORKSPACE` (`pip_parse` / `pip_install`) configurations. PyPI remains explicit opt-in for `socket scan create --auto-manifest` until real-world no-lockfile recovery is validated.
7+
## [1.1.114](https://github.com/SocketDev/socket-cli/releases/tag/v1.1.114) - 2026-06-04
118

129
### Changed
13-
- **Bazel diagnostics**`socket manifest bazel --verbose` now emits bounded subprocess traces with argv, cwd, duration, exit status, output sizes, and failure stderr tails to make customer log-only triage safer and faster.
10+
- `socket manifest gradle`, `kotlin`, and `scala` now generate a Socket facts file (`.socket.facts.json`) by default; pass `--pom` to generate `pom.xml` manifests instead.
11+
- Replaced `--configs` with `--include-configs` and `--exclude-configs` on `socket manifest gradle/kotlin/scala` for finer control over which build configurations are resolved.
1412

1513
## [1.1.113](https://github.com/SocketDev/socket-cli/releases/tag/v1.1.113) - 2026-06-03
1614

15+
### Added
16+
- **`socket manifest bazel [beta]`** — Generate Bazel JVM SBOM manifests by running `bazel query` against discovered Maven repos in a Bazel workspace. Closes the inline-Maven-declaration gap that lockfile-only parsing misses for repos like envoy, ray, tensorflow, tink-java, and or-tools. Auto-detects Bzlmod and legacy `WORKSPACE`.
17+
- **`socket scan create --auto-manifest`** now covers Bazel workspaces in addition to Gradle/Scala/Kotlin/Conda. Repos with `MODULE.bazel`, `WORKSPACE`, or `WORKSPACE.bazel` are detected automatically and their Maven dependencies extracted as part of the standard scan-create flow.
18+
- **Bazel PyPI extraction**`socket manifest bazel --ecosystem pypi` now generates `requirements.txt` for Python Bazel workspaces. Discovers custom `rules_python` pip hub names with Bazel command output first, queries `py_library` / `py_binary` / `py_test` dependencies, resolves canonical pinned versions from `requirements_lock.txt`, and emits PEP 503-normalized `name==version` lines. Supports both Bzlmod (`pip.parse`) and legacy `WORKSPACE` (`pip_parse` / `pip_install`) configurations. PyPI remains explicit opt-in for `socket scan create --auto-manifest` until real-world no-lockfile recovery is validated.
19+
1720
### Changed
18-
- `socket manifest gradle`, `kotlin`, and `scala` now generate a Socket facts file (`.socket.facts.json`) by default; pass `--pom` to generate `pom.xml` manifests instead.
19-
- Replaced `--configs` with `--include-configs` and `--exclude-configs` on `socket manifest gradle/kotlin/scala` for finer control over which build configurations are resolved.
20-
- Updated the Coana CLI to v `15.3.19`.
21+
- **Bazel diagnostics**`socket manifest bazel --verbose` now emits bounded subprocess traces with argv, cwd, duration, exit status, output sizes, and failure stderr tails to make customer log-only triage safer and faster.
22+
- Updated the Coana CLI to v `15.3.20`.
2123

2224
## [1.1.112](https://github.com/SocketDev/socket-cli/releases/tag/v1.1.112) - 2026-05-29
2325

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "socket",
3-
"version": "1.1.113",
3+
"version": "1.1.114",
44
"description": "CLI for Socket.dev",
55
"homepage": "https://github.com/SocketDev/socket-cli",
66
"license": "MIT AND OFL-1.1",
@@ -96,7 +96,7 @@
9696
"@babel/preset-typescript": "7.27.1",
9797
"@babel/runtime": "7.28.4",
9898
"@biomejs/biome": "2.2.4",
99-
"@coana-tech/cli": "15.3.19",
99+
"@coana-tech/cli": "15.3.20",
100100
"@cyclonedx/cdxgen": "12.1.2",
101101
"@dotenvx/dotenvx": "1.49.0",
102102
"@eslint/compat": "1.3.2",

pnpm-lock.yaml

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

requirements.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
},
1111
"fix": {
1212
"quota": 101,
13-
"permissions": ["full-scans:create", "packages:list"]
13+
"permissions": ["full-scans:create", "packages:list", "fixes:list"]
1414
},
1515
"login": {
1616
"quota": 1,

src/commands/fix/cmd-fix.integration.test.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ describe('socket fix', async () => {
160160
161161
API Token Requirements
162162
- Quota: 101 units
163-
- Permissions: full-scans:create and packages:list
163+
- Permissions: fixes:list, full-scans:create, and packages:list
164164
165165
Options
166166
--all Process all discovered vulnerabilities in local mode. Cannot be used with --id.

0 commit comments

Comments
 (0)