Skip to content

Commit 75d920e

Browse files
authored
Merge pull request #17 from HackingRepo/HackingRepo-patch-1
Update Snyk workflow permissions and steps
2 parents e9ccc14 + a3bb14b commit 75d920e

1 file changed

Lines changed: 14 additions & 15 deletions

File tree

.github/workflows/snyk-infrastructure.yml

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,35 +8,34 @@ on:
88
schedule:
99
- cron: '0 0 * * *'
1010

11-
permissions:
12-
contents: read
11+
permissions: read-all
1312

1413
jobs:
1514
snyk:
15+
runs-on: ubuntu-latest
1616
permissions:
1717
contents: read
1818
security-events: write
1919
actions: read
20-
runs-on: ubuntu-latest # Required to fix the job failure
2120

2221
steps:
2322
- name: Checkout Code
24-
uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98 # Pinned to specific SHA
23+
uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98
2524

2625
- name: Setup Node.js
27-
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # Pinned to specific SHA
26+
# SCORECARD FIX: Pinned SHA of the official setup action
27+
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238
2828
with:
29-
node-version: '20'
30-
cache: 'npm'
31-
cache-dependency-path: package.json
29+
node-version: '20'
3230

3331
- name: Install Dependencies
34-
uses: bahmutov/npm-install@c35a7cb7334c91342dde34eab45b35a0065d7f38
35-
with:
36-
useRollingCache: true
37-
38-
- name: Run Snyk to check for vulnerabilities
39-
uses: snyk/actions/node@e2221410bff24446ba09102212d8bc75a567237d # Pinned to specific SHA
32+
run: |
33+
npm install --no-package-lock
34+
npm install
35+
shell: bash
36+
37+
- name: Run Snyk Code (SAST)
38+
uses: snyk/actions/node@e2221410bff24446ba09102212d8bc75a567237d
4039
continue-on-error: true
4140
env:
4241
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
@@ -45,7 +44,7 @@ jobs:
4544
args: --sarif-file-output=snyk-results.sarif
4645

4746
- name: Upload result to GitHub Code Scanning
48-
uses: github/codeql-action/upload-sarif@7434149006143a4d75b82a2f411ef15b03ccc2d7 # Pinned to specific SHA
47+
uses: github/codeql-action/upload-sarif@7434149006143a4d75b82a2f411ef15b03ccc2d7
4948
if: always()
5049
with:
5150
sarif_file: snyk-results.sarif

0 commit comments

Comments
 (0)