GitHub Action & CI/CD
Automate security scanning in every pull request and deployment
GitHub Action
Add Fortly scanning to your GitHub Actions workflow. Create .github/workflows/fortly.yml in your repository.
name: Fortly Security Scanon: pull_request: branches: [main, develop] push: branches: [main]jobs: security-scan: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Run Fortly Scan uses: fortly/fortly-action@v2 with: api-key: ${{ secrets.FORTLY_API_KEY }} scan-type: full # full | quick | sast | secrets | sca fail-threshold: 70 # Fail if score < 70 sarif-upload: true # Upload results to GitHub Security tabAction Options
| Input | Description | Default |
|---|---|---|
| api-key | Fortly API key (use GitHub Secrets) | required |
| scan-type | Type of scan: full, quick, sast, secrets, sca | full |
| fail-threshold | Minimum score to pass (0-100). Fails the job if below. | 0 (disabled) |
| sarif-upload | Generate SARIF file for GitHub Security tab | false |
| target-url | URL to scan (for DAST). Omit for SAST-only. | - |
GitHub Security Tab Integration
When sarif-upload: true is set, Fortly generates a SARIF (Static Analysis Results Interchange Format) file that integrates directly with GitHub's Security tab.
- Vulnerabilities appear in Security > Code scanning alerts
- PR annotations show inline warnings on affected lines
- Branch protection rules can require Fortly to pass before merge
- Supports dismiss, reopen, and false positive workflows
Bitbucket Pipe
pipelines: pull-requests: '**': - step: name: Fortly Security Scan script: - pipe: fortly/fortly-pipe:2.0 variables: FORTLY_API_KEY: $FORTLY_API_KEY SCAN_TYPE: "full" FAIL_THRESHOLD: "70"CLI in CI Mode
Use the Fortly CLI directly in any CI system (Jenkins, GitLab CI, CircleCI, etc.).
# Install the CLInpm install -g fortly-cli# Configure API keyexport FORTLY_API_KEY=$FORTLY_API_KEY# Run scan in CI mode (exits with code 1 if score < threshold)fortly scan https://staging.myapp.com --ci --fail-threshold 70# Or scan local code (SAST only)fortly scan . --ci --fail-threshold 80 --format sarif