-
Notifications
You must be signed in to change notification settings - Fork 559
ci: add Semgrep OSS scanning workflow #1376
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
8641173
ci: add Semgrep OSS scanning workflow
hrushikeshdeshpande 0fe9945
Merge branch 'main' into hrushikesh/add-semgrep-oss-workflow
whoiskatrin 727d051
Update .github/workflows/semgrep.yml
whoiskatrin 95d5f8c
format semgrep workflow
whoiskatrin 7c9fa07
fix closed websocket replay race
whoiskatrin fdd982c
fix replayChunks bare send and gate semgrep cron to first Saturday
whoiskatrin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| --- | ||
| "agents": patch | ||
| "@cloudflare/ai-chat": patch | ||
| --- | ||
|
|
||
| Avoid throwing when chat stream resume/replay races with a closed WebSocket connection. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| name: Semgrep OSS scan | ||
| on: | ||
| pull_request: {} | ||
| push: | ||
| branches: [main, master] | ||
| workflow_dispatch: {} | ||
| schedule: | ||
| # Run at midnight UTC on Saturdays. The `gate` job below filters | ||
| # scheduled runs to the first Saturday of each month. We avoid | ||
| # encoding "first Saturday" in cron itself because POSIX cron applies | ||
| # OR semantics when both day-of-month and day-of-week are | ||
| # non-wildcard, so e.g. `0 0 1-7 * 6` would fire every day 1-7 *and* | ||
| # every Saturday, not just the first Saturday. | ||
| - cron: "0 0 * * 6" | ||
| concurrency: | ||
| group: semgrep-${{ github.event_name }}-${{ github.head_ref || github.run_id }} | ||
| cancel-in-progress: true | ||
| permissions: | ||
| contents: read | ||
| jobs: | ||
| gate: | ||
| name: gate | ||
| runs-on: ubuntu-slim | ||
| outputs: | ||
| run: ${{ steps.check.outputs.run }} | ||
| steps: | ||
| - id: check | ||
| shell: bash | ||
| run: | | ||
| if [ "${{ github.event_name }}" != "schedule" ]; then | ||
| echo "run=true" >> "$GITHUB_OUTPUT" | ||
| exit 0 | ||
| fi | ||
| DAY=$(date -u +%-d) | ||
| if [ "$DAY" -le 7 ]; then | ||
| echo "run=true" >> "$GITHUB_OUTPUT" | ||
| else | ||
| echo "run=false" >> "$GITHUB_OUTPUT" | ||
| echo "Skipping scheduled run: day-of-month $DAY is not in the first 7 days." | ||
| fi | ||
| semgrep: | ||
| name: semgrep-oss | ||
| needs: [gate] | ||
| if: needs.gate.outputs.run == 'true' | ||
| runs-on: ubuntu-slim | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| with: | ||
| fetch-depth: 1 | ||
| - id: cache-semgrep | ||
| uses: actions/cache@v5 | ||
| with: | ||
| path: ~/.local | ||
| key: semgrep-1.160.0-${{ runner.os }} | ||
| - if: steps.cache-semgrep.outputs.cache-hit != 'true' | ||
| run: pip install --user semgrep==1.160.0 | ||
| - run: echo "$HOME/.local/bin" >> "$GITHUB_PATH" | ||
| - run: semgrep scan --config=auto |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.