[go: up one dir, main page]

Skip to content

Socket branch name needs slug

When sending Renovate branches, which by default have a /, the following error is seen. Change --branch=$CI_COMMIT_REF_NAME to --branch=$CI_COMMIT_REF_SLUG to resolve.

$ npm i -g socket@0.14.150
added 1 package in 1s
$ socket scan create --report --json --repo=$CI_PROJECT_NAME --branch=$CI_COMMIT_REF_NAME $SOCKET_ORG_NAME . | tee socket-report.json
   _____         _       _        /---------------
  |   __|___ ___| |_ ___| |_      | Socket.dev CLI ver 0.14.150:cc2913a:aa0fe20d:pub
  |__   | * |  _| '_| -_|  _|     | Node: v22.15.0, API token set: PLNcD
  |_____|___|___|_,_|___|_|.dev   | Command: `socket scan create`, cwd: /builds/gitlab-ci-utils/gitlab-ui-plus
 Requesting supported scan file types from API...
✔ Received response while fetched supported scan file types.
 Searching for local files to include in scan...
✔ Found 2 local files
 Sending request to create a scan with 2 packages...
✔ Completed request to create a new scan.
✖️  Socket API returned an error:  Socket API POST request failed (400): Bad Request (reason: Invalid branch name: 250 or less A-Za-z0-9 characters only with non-repeating, non-leading or trailing spaces, ., _ or - only)
Cleaning up project directory and file based variables
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information