You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit a5b1c93
Browse filesBrowse the repository at this point in the historyBrowse files
- GitHub Actions for [pull requests](https://github.com/SocketDev/socket-python-cli/blob/main/workflows/github-actions.yml), [pushes](https://github.com/SocketDev/socket-python-cli/blob/main/workflows/github-actions-push.yml), and [ignore commands](https://github.com/SocketDev/socket-python-cli/blob/main/workflows/github-actions-comments.yml)
Copy file name to clipboardExpand all lines: docs/ci-cd.md
+40-40Lines changed: 40 additions & 40 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -504,8 +504,8 @@ With `--scm github` or `--scm gitlab`, the detected event decides the scan type:
504
504
505
505
| Event | Scan | Blocks the build |
506
506
|:------|:-----|:-----------------|
507
-
| Pull request / merge request | Diff scan against the repository's baseline | Yes, on new blocking alerts; also existing blockers with `--strict-blocking` |
508
-
| Any other pipeline, including default-branch pushes | Full scan | No |
507
+
| Supported pull request / merge request events | Diff scan against the repository's baseline when a comparison runs | Yes, on new blocking alerts and on existing blockers with `--strict-blocking` |
508
+
| Push without a PR/MR number, including default-branch pushes | Full scan | No blocking on findings |
509
509
510
510
A full scan has no baseline, so it cannot tell a newly introduced alert from one
511
511
that was already there. Rather than block on a number that would mean something
@@ -525,43 +525,43 @@ fetches the package list for them.
525
525
526
526
With `--scm github`, `pull_request` runs scan on the `opened`, `synchronize`,
527
527
`reopened`and `ready_for_review` actions. Other actions (`closed`, `labeled`,
528
-
`edited`, ...) and events the CLI does not handle (`pull_request_target`,
529
-
`merge_group`, `schedule`, ...) are skipped: no scan runs, the CLI logs a warning
530
-
and exits `0`. `issue_comment` runs the ignore-command flow, not a scan. With
531
-
`--scm gitlab`, pipeline sources other than `web`, `merge_request_event`, `push`,
532
-
`api`, `pipeline` and the comment flow are skipped the same way.
533
-
534
-
GitHub doesn't document which run a required check uses when a job with the same
535
-
name runs more than once on a commit, so a skipped run that passes can satisfy the
536
-
check in place of an earlier failure. Subscribe the Socket job only to events and
537
-
actions the CLI scans.
538
-
539
-
- `merge_group`: if the required check also runs on merge queue events, the job
540
-
passes there without scanning. The `pull_request` run is the gate.
541
-
- `pull_request_target`is skipped because it runs against the base branch, so it
542
-
can't stand in for `pull_request` on fork pull requests. Fork pull requests on
543
-
`pull_request`get no repository secrets, so the CLI has no API token and exits
544
-
`3`(or the `--exit-code-on-api-error` value). Decide how fork pull requests get
545
-
a token before making the check required.
546
-
547
-
### Push and pull request runs on the same commit
548
-
549
-
The [example workflow](../workflows/github-actions.yml) runs one `socket-security`
550
-
job on `push` to every branch and on `pull_request`. A new commit on a pull
551
-
request's branch triggers both events on the same head commit. The `pull_request`
552
-
run compares against the baseline and can fail. The `push` run is a full scan,
553
-
which never blocks and exits `0`. Both runs report a check with the same name, so
554
-
a required check can resolve against the passing `push` run.
555
-
556
-
If the Socket job is a required check, do one of these:
557
-
558
-
- Restrict `push` to the default branch (`branches: [main]`). Default-branch scans
559
-
still keep the baseline current; feature branches are scanned only through their
560
-
pull requests.
561
-
- Run the pull request scan in its own job (for example `socket-pr` with
562
-
`if: github.event_name == 'pull_request'`, and
563
-
`if: github.event_name != 'pull_request'` on the existing job), and require that
564
-
job's check.
528
+
`edited`, and others) and unsupported events log a warning and exit `0` without
529
+
scanning. `issue_comment` handles ignore commands. With `--scm gitlab`, the
530
+
recognized scan sources are `web`, `merge_request_event`, `push`, `api`, and
531
+
`pipeline`. Other sources, apart from the comment flow, also warn and exit `0`
532
+
without scanning.
533
+
534
+
- A GitHub merge queue evaluates required checks on the `merge_group` commit.
535
+
The CLI skips that event. Use a check that scans the merge group for
- GitHub Actions for [pull requests](../workflows/github-actions.yml), [pushes](../workflows/github-actions-push.yml), and [ignore commands](../workflows/github-actions-comments.yml)
0 commit comments