1+ name : Socket Fix
2+
3+ # Recommended schedule for calling workflows:
4+ # schedule:
5+ # - cron: '0 0 * * *' # Run daily at midnight UTC
6+ # - cron: '0 12 * * *' # Run daily at noon UTC
7+
8+ on :
9+ workflow_call :
10+ inputs :
11+ debug :
12+ description : ' Enable debug output'
13+ required : false
14+ type : string
15+ default : ' 0'
16+ node-version :
17+ description : ' Node version to use'
18+ required : false
19+ type : string
20+ default : ' 22'
21+ glob-pattern :
22+ description : ' Glob pattern for files to fix'
23+ required : false
24+ type : string
25+ default : ' '
26+ autopilot :
27+ description : ' Enable autopilot mode'
28+ required : false
29+ type : boolean
30+ default : true
31+ git-user-email :
32+ description : ' Git user email for commits'
33+ required : false
34+ type : string
35+ default : ' socket-fix[bot]@users.noreply.github.com'
36+ git-user-name :
37+ description : ' Git user name for commits'
38+ required : false
39+ type : string
40+ default : ' socket-fix[bot]'
41+ secrets :
42+ socket_cli_api_token :
43+ required : true
44+ github_token :
45+ required : true
46+
47+ permissions :
48+ contents : write
49+ pull-requests : write
50+
51+ jobs :
52+ socket-fix :
53+ runs-on : ubuntu-latest
54+ steps :
55+ - name : Checkout repo
56+ uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
57+
58+ - name : Setup debug
59+ uses : SocketDev/socket-registry/.github/actions/debug@main
60+ with :
61+ debug : ${{ inputs.debug }}
62+
63+ - uses : SocketDev/socket-cli/.github/actions/setup@main
64+ with :
65+ node-version : ${{ inputs.node-version }}
66+
67+ - name : Run Socket Fix CLI
68+ env :
69+ SOCKET_CLI_GITHUB_TOKEN : ${{ secrets.github_token }}
70+ SOCKET_CLI_GIT_USER_EMAIL : ${{ inputs.git-user-email }}
71+ SOCKET_CLI_GIT_USER_NAME : ${{ inputs.git-user-name }}
72+ SOCKET_CLI_API_TOKEN : ${{ secrets.socket_cli_api_token }}
73+ run : |
74+ AUTOPILOT_FLAG=""
75+ GLOB_FLAG=""
76+
77+ if [[ "${{ inputs.autopilot }}" == "true" ]]; then
78+ AUTOPILOT_FLAG="--autopilot"
79+ fi
80+
81+ if [[ -n "${{ inputs.glob-pattern }}" ]]; then
82+ GLOB_FLAG="--glob '${{ inputs.glob-pattern }}'"
83+ fi
84+
85+ pnpm dlx @socketsecurity/cli fix $AUTOPILOT_FLAG $GLOB_FLAG
0 commit comments