Add Semgrep/ShellCheck SAST and Trivy scanning to CI - #68
Merged
Conversation
Co-authored-by: jeffw16 <11380894+jeffw16@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
jeffw16
July 31, 2026 07:14
View session
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
Suppressed comments (3)
.github/workflows/ci.yml:137
- This SARIF upload step is expected to fail on fork PRs due to read-only tokens; with continue-on-error it won’t gate CI, but it still produces noisy auth errors. Add an
if:guard to skip the upload for fork PRs so the job output stays clean and matches the docs’ “skipped silently” wording.
- name: Upload Trivy results to GitHub Security
continue-on-error: true
uses: github/codeql-action/upload-sarif@e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81 # v4.37.3
.github/workflows/ci.yml:97
- Same as above: this SARIF upload step will still run on fork PRs and emit auth-related errors/warnings (even though it won’t fail the job). Add an
if:guard to skip the upload when the PR’s head repo isn’t this repository.
- name: Upload shell Semgrep results to GitHub Security
continue-on-error: true
uses: github/codeql-action/upload-sarif@e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81 # v4.37.3
.github/workflows/ci.yml:85
- The workflow documentation says SARIF uploads are skipped silently for fork PRs, but this step will still run (and typically log an auth error) on fork PRs even with continue-on-error. Add an explicit
if:guard so the upload step is actually skipped when the PR comes from a different repository, reducing noise for contributors and aligning behavior with the docs.
This issue also appears in the following locations of the same file:
- line 95
- line 135
- name: Upload Semgrep results to GitHub Security
# Pull requests from forks only get a read-only token, so the upload cannot succeed there.
continue-on-error: true
uses: github/codeql-action/upload-sarif@e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81 # v4.37.3
jeffw16
marked this pull request as ready for review
July 31, 2026 07:23
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Adds security scanning to CI, adapted from the SAST job in CanastaWiki/CanastaBase, plus a Trivy filesystem scan. Findings are published to the repository Security tab as SARIF rather than gating the build.
sastjobp/phpover PHP files andp/security-auditover shell files, uploaded under categoriessemgrep-phpandsemgrep-shell.--shell=bash, severityerror) over.github/scripts._sourcestarget andwait-for-it.shexclusion don't exist here, so scans target the repo root with--exclude vendor --exclude build, and ShellCheck usesscandir: ./.github/scripts.trivyjobscan-type: fswithvuln,secret,misconfigscanners, SARIF output limited to CRITICAL/HIGH/MEDIUM,exit-code: 0.Conventions
ci.yml.security-events: write(workflow default remainscontents: read).continue-on-error: true— fork PRs receive a read-only token and cannot upload.Docs
.github/CI-SETUP.mdand.github/copilot-instructions.mddescribe the new jobs.No
extension.jsonbump: the version gate ignores hidden-path-only changes.Note: Semgrep rulesets could not be exercised locally (
semgrep.devis unreachable from the sandbox), so the first CI run is the real check on rule output.