@@ -26,19 +26,15 @@ jobs:
2626 pull-requests : write
2727 runs-on : ubuntu-latest
2828
29+ # Option 1: Use the official Socket CLI container (faster, more reliable)
30+ container : socketdev/cli:latest
31+
2932 steps :
3033 - uses : actions/checkout@v4
3134 with :
3235 # For PRs, fetch one additional commit for proper diff analysis
3336 fetch-depth : ${{ github.event_name == 'pull_request' && 2 || 0 }}
3437
35- - uses : actions/setup-python@v5
36- with :
37- python-version : ' 3.12'
38-
39- - name : Install Socket CLI
40- run : pip install socketsecurity --upgrade
41-
4238 - name : Run Socket Security Scan
4339 env :
4440 SOCKET_SECURITY_API_KEY : ${{ secrets.SOCKET_SECURITY_API_KEY }}
6561 --target-path $GITHUB_WORKSPACE \
6662 --scm github \
6763 --pr-number $PR_NUMBER
64+
65+ # Alternative Option 2: Traditional Python setup (if you prefer not to use containers)
66+ # Replace the job above with this version if you want to use the traditional approach:
67+ #
68+ # socket-security:
69+ # permissions:
70+ # issues: write
71+ # contents: read
72+ # pull-requests: write
73+ # runs-on: ubuntu-latest
74+ #
75+ # steps:
76+ # - uses: actions/checkout@v4
77+ # with:
78+ # fetch-depth: ${{ github.event_name == 'pull_request' && 2 || 0 }}
79+ #
80+ # - uses: actions/setup-python@v5
81+ # with:
82+ # python-version: '3.12'
83+ #
84+ # - name: Install Socket CLI
85+ # run: pip install socketsecurity --upgrade
86+ #
87+ # - name: Run Socket Security Scan
88+ # env:
89+ # SOCKET_SECURITY_API_KEY: ${{ secrets.SOCKET_SECURITY_API_KEY }}
90+ # GH_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
91+ # run: |
92+ # PR_NUMBER=0
93+ # if [ "${{ github.event_name }}" == "pull_request" ]; then
94+ # PR_NUMBER=${{ github.event.pull_request.number }}
95+ # elif [ "${{ github.event_name }}" == "issue_comment" ]; then
96+ # PR_NUMBER=${{ github.event.issue.number }}
97+ # fi
98+ #
99+ # socketcli \
100+ # --target-path $GITHUB_WORKSPACE \
101+ # --scm github \
102+ # --pr-number $PR_NUMBER
0 commit comments