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 a38c880
Browse filesBrowse the repository at this point in the historyBrowse files
Scan reopened pull requests instead of passing them unscanned (#460)
* Scan reopened pull requests instead of passing them unscanned
With --scm github, a pull_request run whose action was not opened or
synchronize logged "Pull Request Action reopened is not a supported type"
and exited 0 without scanning. The example workflow subscribes to
reopened, and a required check takes the latest run on the head commit,
so reopening a pull request could replace a failed Socket check with a
pass on the same commit.
reopened and ready_for_review now run the same comparison as opened and
synchronize. Other actions and unhandled events are still skipped with
exit 0, as the exit-code contract documents, but log a warning that no
scan ran. pull_request_target gets its own message because it runs
against the base branch, so it is not treated as pull_request. GitLab's
unhandled pipeline sources log the same warning.
* Say when the event or action is missing, and that issue_comment doesn't scan
A missing pull_request action or GITHUB_EVENT_NAME (or CI_PIPELINE_SOURCE on
GitLab) now gets its own warning instead of "action 'None' is not scanned",
whose advice to drop the action from the workflow didn't apply. The skip
warnings list issue_comment as handling ignore commands, not as a scanned
event. Tests pin push, workflow_dispatch and issue_comment routing.
* Document the push/pull_request overlap in the example workflow
Move the Skipped events section below the scan-type paragraphs it had split.
State the required-check risk without claiming which run GitHub picks.
Explain that push on every branch also runs the job on a pull request's head
commit as a full scan that exits 0, and give two ways to keep that run from
satisfying a required check.
* Bump version to 2.13.3
2.13.2 was released from main, so this change needs the next patch version.
* Isolate the GitHub PR check and prepare CLI 2.14.0
* Warn that the PR workflow alone stops baseline updates
---------
Co-authored-by: lelia <2418071+lelia@users.noreply.github.com>
- 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
+51-5Lines changed: 51 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -84,8 +84,9 @@ they also hide findings and usage errors. Even with exit `0`, a setup/API failur
84
84
does not mean a clean scan; check the logs for a completed report.
85
85
86
86
Findings block only when a [diff comparison runs](#scan-type-by-pipeline).
87
-
SCM event filters can also skip unsupported events with exit `0`; confirm a report
88
-
was created when validating a new workflow.
87
+
SCM event filters can also skip unsupported events with exit `0` and a warning
88
+
(see [Skipped events](#skipped-events)); confirm a report was created when
89
+
validating a new workflow.
89
90
The CLI treats comparisons marked incomplete or returned with missing or
90
91
invalid package lists as infrastructure failures. With `--strict-blocking`,
91
92
incomplete existing-alert data is also an infrastructure failure. See the
@@ -506,8 +507,8 @@ comparison path.
506
507
507
508
| Event | Scan | Blocks the build |
508
509
|:------|:-----|:-----------------|
509
-
| Pull request / merge request | Diff scan against the repository's baseline | Yes, on new blocking alerts; also existing blockers with `--strict-blocking` |
510
-
| Any other pipeline, including default-branch pushes | Full scan | No |
510
+
| 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` |
511
+
| Push without a PR/MR number, including default-branch pushes | Full scan | No blocking on findings |
511
512
512
513
With changed-file detection, a PR/MR with no supported manifest change runs a
513
514
full scan by default. Use `--strict-blocking` or `--ignore-commit-files` to
@@ -524,6 +525,51 @@ when upgrading a pipeline that previously ran only full scans.
524
525
`--generate-license`and `--legal-format fossa` work on both paths; a full scan
525
526
fetches the package list for them.
526
527
528
+
### Skipped events
529
+
530
+
With `--scm github`, `pull_request` runs scan on the `opened`, `synchronize`,
531
+
`reopened`and `ready_for_review` actions. Other actions (`closed`, `labeled`,
532
+
`edited`, and others) and unsupported events log a warning and exit `0` without
533
+
scanning. `issue_comment` handles ignore commands. With `--scm gitlab`, the
534
+
recognized scan sources are `web`, `merge_request_event`, `push`, `api`, and
535
+
`pipeline`. Other sources, apart from the comment flow, also warn and exit `0`
536
+
without scanning.
537
+
538
+
- A GitHub merge queue evaluates required checks on the `merge_group` commit.
539
+
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