Skip to content

Commit e95e1e5

Browse files
committed
test: enable Socket Security Github Action
eggjs/egg#5430
1 parent fbbd50b commit e95e1e5

3 files changed

Lines changed: 37 additions & 4 deletions

File tree

.github/workflows/ci.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@ name: CI
22

33
on:
44
push:
5-
branches: [master]
5+
branches:
6+
- master
67
pull_request:
7-
branches: [master]
8+
branches:
9+
- master
810
merge_group:
911

1012
jobs:
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: socket-security-workflow
2+
run-name: Socket Security Github Action
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
jobs:
11+
socket-security:
12+
permissions:
13+
contents: read # This is enough to clone the repo and read files
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
- uses: actions/setup-python@v5
20+
with:
21+
python-version: '3.12'
22+
- name: Install Socket CLI
23+
run: pip install socketsecurity --upgrade
24+
- name: Run scan
25+
env:
26+
SOCKET_SECURITY_API_KEY: ${{ secrets.SOCKET_SECURITY_API_KEY }}
27+
GH_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
29+
COMMIT_SHA: ${{ github.sha }} # Getting the commit SHA
30+
run: |
31+
socketcli --scm github --repo ${{ github.event.repository.name }} --branch "${{ github.ref_name }}" --default-branch --pr_number 0 --commit-sha "$COMMIT_SHA" --committer "$GITHUB_ACTOR" --commit_message "$COMMIT_MESSAGE" --target_path $GITHUB_WORKSPACE --disable-blocking

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
},
1818
"homepage": "https://github.com/node-modules/read-env-value#readme",
1919
"engines": {
20-
"node": ">= 22.17.0"
20+
"node": ">= 22.18.0"
2121
},
2222
"devDependencies": {
2323
"@eggjs/tsconfig": "3",
@@ -32,7 +32,7 @@
3232
"scripts": {
3333
"lint": "oxlint",
3434
"pretest": "npm run lint -- --fix",
35-
"test": "node --test --experimental-strip-types",
35+
"test": "node --test",
3636
"preci": "npm run lint",
3737
"ci": "c8 -r html -r lcov -r text npm test",
3838
"postci": "npm run prepublishOnly",

0 commit comments

Comments
 (0)