๐Ÿ›ก๏ธSecOSS

SecOSS GitHub Action

Composite Action

Automatically scan your dependencies for CVEs on every pull request and post a formatted vulnerability report as a PR comment โ€” completely free, no API key required.

โœ… Posts comment on every PR๐Ÿ”„ Updates existing comment on re-run๐Ÿšซ Fails build on critical CVEs๐Ÿ”‘ No API key or signup๐Ÿ†“ Completely free

Quick Setup

1

Create the workflow file

Create .github/workflows/secoss.yml in your repository with this content:

yaml
name: SecOSS Security Scan

on:
  pull_request:
    branches: ['*']

jobs:
  secoss:
    runs-on: ubuntu-latest
    permissions:
      pull-requests: write
      contents: read
    steps:
      - uses: actions/checkout@v4

      - uses: rafraf-ops/SecurityForOpenSource-@main
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          fail-on: critical
2

Open a pull request

The workflow triggers automatically on every new PR. No further configuration needed.

3

Review the comment

SecOSS posts a formatted vulnerability table. On subsequent commits to the same PR, the comment is updated in place rather than creating a new one.

Example PR Comment

This is what the comment looks like on a PR with vulnerabilities:

G
github-actionsbotjust now

๐Ÿ›ก๏ธ SecOSS Security Scan

โš ๏ธ Found 3 vulnerabilities across 2 lockfiles.

SeverityCount
๐Ÿ”ด Critical1
๐ŸŸ  High 2
๐ŸŸก Medium 0
๐Ÿ”ต Low 0
๐Ÿ“ฆ Lockfile details

package-lock.json

Packages: 214 ยท Vulnerable: 2 ยท Critical: 1 ยท High: 1

requirements.txt

Packages: 18 ยท Vulnerable: 1 ยท Critical: 0 ยท High: 1


Powered by SecOSS ยท API docs ยท fail-on: critical

When no vulnerabilities are found, the comment shows a โœ… green status instead. The comment is automatically updated on every new commit push.

Inputs

InputDefaultDescription
github-tokengithub.tokenToken used to post PR comments and call the GitHub API for scanning. The built-in token works for public repos.
fail-oncriticalSeverity threshold that fails the workflow. Options: critical ยท high ยท medium ยท any ยท never
secoss-apihttps://app.cloudrf.xyzSecOSS API base URL. Override only if self-hosting the API.

Outputs

Use outputs to make decisions in downstream steps:

OutputDescription
criticalNumber of critical vulnerabilities found across all lockfiles.
highNumber of high vulnerabilities found.
mediumNumber of medium vulnerabilities found.
lowNumber of low vulnerabilities found.
totalTotal vulnerabilities found.

Full Workflow Example

Advanced setup with outputs and push-to-main scanning:

yaml
name: SecOSS Security Scan

on:
  pull_request:
    branches: ['*']
  push:
    branches: [main]        # also scan the main branch on merge

jobs:
  secoss:
    runs-on: ubuntu-latest
    permissions:
      pull-requests: write  # needed to post PR comments
      contents: read

    steps:
      - uses: actions/checkout@v4

      - name: SecOSS โ€” dependency CVE scan
        id: secoss
        uses: rafraf-ops/SecurityForOpenSource-@main
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          fail-on: critical       # critical | high | medium | any | never

      # Optional: use outputs in downstream steps
      - name: Print summary
        if: always()
        run: |
          echo "Critical : ${{ steps.secoss.outputs.critical }}"
          echo "High     : ${{ steps.secoss.outputs.high }}"
          echo "Total    : ${{ steps.secoss.outputs.total }}"

How it works

  1. On a pull request event, the Action calls POST https://app.cloudrf.xyz/api/scan/github with your repo URL and the built-in GitHub token.
  2. SecOSS fetches your repository, discovers all lockfiles (package-lock.json, yarn.lock, requirements.txt, and more), and queries OSV.dev + GitHub Advisory DB for matching CVEs.
  3. A markdown comment is posted (or the existing SecOSS comment is updated) on the pull request.
  4. If fail-on threshold is exceeded the Action exits with code 1, failing the workflow check.

No data is retained โ€” all scan results are computed in-memory and discarded after the API response.

Supported Lockfiles

package-lock.jsonnpm
yarn.lockYarn
pnpm-lock.yamlpnpm
requirements.txtpip
Pipfile.lockPipenv
Cargo.lockRust
go.sumGo
Gemfile.lockRuby
composer.lockPHP

Required permissions

The workflow needs pull-requests: write to post comments, and contents: read to allow SecOSS to fetch your repository. These permissions are shown in the workflow template above.

For private repositories the built-in GITHUB_TOKEN works automatically. No additional secrets needed.