@@ -513,27 +513,55 @@ different depending on which output format was enabled, those runs behave as if
513513` --disable-blocking` was supplied and report through the Dashboard instead. This
514514matches how the CLI already treats a run with no supported manifest files.
515515
516+ The event type is authoritative once `--scm` is set : ` --enable-diff` and
517+ ` --ignore-commit-files` do not turn a branch pipeline into a comparison. To diff
518+ a branch build, drop `--scm` and use `--enable-diff` with `--integration`, which
519+ runs the comparison without the PR comment adapter.
520+
521+ ` --generate-license` and `--legal-format fossa` work on both paths; a full scan
522+ fetches the package list for them.
523+
516524# ## Skipped events
517525
518526With `--scm github`, `pull_request` runs scan on the `opened`, `synchronize`,
519527` reopened` and `ready_for_review` actions. Other actions (`closed`, `labeled`,
520528` edited` , ...) and events the CLI does not handle (`pull_request_target`,
521529`merge_group`, `schedule`, ...) are skipped : no scan runs, the CLI logs a warning
522- and exits `0`. With `--scm gitlab`, pipeline sources other than `web`,
523- ` merge_request_event ` , `push `, `api `, `pipeline` and the comment flow are skipped
524- the same way.
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.
525533
526- A required check takes the latest run on the head commit, so a skipped run that
527- passes can replace an earlier failure. Subscribe the Socket job only to events and
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
528537actions the CLI scans.
529538
530- The event type is authoritative once `--scm` is set : ` --enable-diff` and
531- ` --ignore-commit-files` do not turn a branch pipeline into a comparison. To diff
532- a branch build, drop `--scm` and use `--enable-diff` with `--integration`, which
533- runs the comparison without the PR comment adapter.
534-
535- ` --generate-license` and `--legal-format fossa` work on both paths; a full scan
536- fetches the package list for them.
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.
537565
538566# # Pull request and Dashboard association
539567
0 commit comments