Skip to content

Commit 380b63b

Browse files
committed
fix: findings in local repo
1 parent 83f0d70 commit 380b63b

File tree

2 files changed

+15
-24
lines changed

2 files changed

+15
-24
lines changed

.github/workflows/action-run-semgrep.yaml

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,12 @@
11
name: Semgrep CI
22
on:
33
workflow_call:
4-
secrets:
5-
SARIF_TO_GH_COMMENT_APP_ID:
6-
required: true
7-
description: >
8-
The ID of the GitHub application that exports SARIF results as pull request
9-
annotations.
10-
SARIF_TO_GH_COMMENT_APP_INSTALL_ID:
11-
required: true
12-
description: >
13-
The repository or organization's installation ID of the GitHub application
14-
exporting SARIF results as pull request annotations.
15-
SARIF_TO_GH_COMMENT_APP_KEY:
16-
required: true
17-
description: >
18-
The private key of the GitHub application exporting SARIF results
19-
as pull request annotations.
204
inputs:
5+
sarif-export-environment:
6+
type: string
7+
required: true
8+
description: The GitHub environment to use to exports results.
9+
2110
check_name:
2211
type: string
2312
default: ""
@@ -74,14 +63,17 @@ env:
7463
DEFAULT_EXCLUDE_RULE_IDS: |
7564
yaml.github-actions.security.run-shell-injection.run-shell-injection
7665
77-
permissions:
78-
contents: read
66+
permissions: {}
7967

8068
jobs:
8169
scan:
8270
if: (github.actor != 'dependabot[bot]')
8371
name: semgrep/ci
8472
runs-on: ubuntu-24.04
73+
74+
permissions:
75+
contents: read
76+
8577
container:
8678
# Note: the non-root flavor doesn't work on GHA (e.g., 1.57.0-nonroot).
8779
image: returntocorp/semgrep:1.153.1@sha256:50b839b576d76426efd3e5cffda2db0d8c403f53aa76e91d42ccf51485ac336c
@@ -178,6 +170,7 @@ jobs:
178170
- scan
179171
name: SARIF to PR Annotations
180172
runs-on: ubuntu-24.04
173+
environment: ${{ inputs.sarif-export-environment }}
181174
container:
182175
# Note: distroless flavor doesn't work on GHA.
183176
image: ghcr.io/nyankiyoshi/less-advanced-security@sha256:689f73bed448ce40ca4ed01f6585f22665c0c302ed0e882d1fc78016c12f2880 # 0.5.0

.github/workflows/run-semgrep.yaml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,10 @@ on:
44
types:
55
- synchronize
66
- opened
7-
permissions:
8-
contents: read
97
jobs:
108
scanner:
9+
permissions:
10+
contents: read
1111
uses: ./.github/workflows/action-run-semgrep.yaml
12-
secrets:
13-
SARIF_TO_GH_COMMENT_APP_ID: ${{ secrets.SARIF_TO_GH_COMMENT_APP_ID }}
14-
SARIF_TO_GH_COMMENT_APP_INSTALL_ID: ${{ secrets.SARIF_TO_GH_COMMENT_APP_INSTALL_ID }}
15-
SARIF_TO_GH_COMMENT_APP_KEY: ${{ secrets.SARIF_TO_GH_COMMENT_APP_KEY }}
12+
with:
13+
sarif-export-environment: semgrep-export-sarif

0 commit comments

Comments
 (0)