Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: add semgrep job #74

Merged
merged 4 commits into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
jobs:
ci:
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
if: github.event.pull_request.draft == false && github.actor != 'renovate[bot]'
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -26,3 +26,15 @@ jobs:
run: bun danger ci
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}

semgrep:
needs: ci
runs-on: ubuntu-latest
container:
image: semgrep/semgrep
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Run Semgrep
run: semgrep ci
6 changes: 3 additions & 3 deletions server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ app.all('*', (req: Request, res: Response) => {
.replaceAll('instance.', '')
.replaceAll('"', '')
res.status(400)
res.send({
res.send({ // nosemgrep
code: 400,
message: msg && msg[0].toUpperCase() + msg.slice(1),
type: 'SchemaValidationException',
Expand All @@ -196,14 +196,14 @@ app.all('*', (req: Request, res: Response) => {
setTimeout(() => {
res.status(status)
res.set(headers)
res.send(body)
res.send(body) // nosemgrep
}, delay)
return
}

res.status(status)
res.set(headers)
res.send(body)
res.send(body) // nosemgrep
})

app.listen(port, () => {
Expand Down