GitHub Actions

Last updated: Nov 11, 2026


Fluid Attacks has dedicated GitHub Actions for automated security testing directly in your CI/CD pipeline.

ActionScannerDescription
SASTStatic Application Security TestingDetects vulnerabilities in your source code
SCASoftware Composition AnalysisDetects known CVEs in your dependencies
Secret ScanSecrets DetectionDetects hardcoded credentials and secrets
DASTDynamic Application Security TestingDetects vulnerabilities in live web applications
CI GatePlatform integrationBlocks merges when policy-breaking vulnerabilities are present

How it works

The SAST, SCA, and Secret Scan actions have the same main workflow structure. It has a checkout step, the scanner action, and an optional SARIF upload to GitHub's Security tab.

By default, the SAST, SCA, and Secret Scan actions run a full scan, for all triggers. To scan only the changed files, set the scanner_mode: diff action input. Fluid Attacks recommends it for SAST. In differential mode, the base for the comparison depends on the Git event that started the workflow:

  • Pull request → changed files relative to the PR base branch.
  • Push to the default branch → changed files since the commit before the push.
  • Push to any other branch → changed files relative to the default branch.
  • Any other event (scheduled or manual) → full scan.

The differential mode keeps CI fast and makes sure that the action finds new vulnerabilities before they get to the default branch. It needs fetch-depth: 0 in the checkout step. If there is no base commit, or no file changed, the action runs a full scan or skips the scan, respectively. The DAST action has no differential mode.

Authenticate (optional)

When you authenticate, the Fluid Attacks platform attributes each scan to your Fluid Attacks group with a Group token. On GitHub Actions, give the action the group input. Give the workflow the id-token: write permission. Add a trust for the repository. The run then gets a short-lived token from OIDC and authenticates without a secret.

As an alternative, keep a long-lived Group token as a secret. Give it in the api_token input. The token identifies the group, so you do not need the group input. If you give a token, the action uses it and not OIDC. Without a token or OIDC credentials, the scan runs without authentication.

For the setup, read Authentication and OIDC federation.

What it looks like in GitHub

Job steps

After a push or pull request, the workflow appears in the Actions tab with each step: checkout, scan, and upload.

GitHub Actions job steps for the SCA workflow in machine_flow

Scanner logs

When you expand the scan step, you see the scanner output. It shows the files or dependency manifests that the scanner found, the vulnerabilities that it detected, and if the run was a full or differential scan.

Scanner log output in the SCA GitHub Actions step

Security tab results

After the SARIF file uploads, the findings appear in the Security → Code scanning panel of the repository. Each finding shows the severity, file location, and description of the vulnerability.

GitHub Security tab showing SCA findings from machine_flow

GitHub Advanced Security

To upload scan results to the GitHub Security tab, you must have GitHub Advanced Security. It is available on all public repositories and on private repositories with a GitHub Advanced Security license. On private repositories without that license, the upload step fails.

Always use if: always() in the upload step. Thus, the step uploads the results each time, also when the scan step exits with a non-zero code (for example, when you set strict: true):

- name: Upload SARIF
  if: always()
  uses: github/codeql-action/upload-sarif@v4
  with:
    sarif_file: ${{ steps.scan.outputs.sarif_file }}

Common scenarios

Strict mode: block merges with vulnerabilities

By default, the actions report vulnerabilities without failing the job. Set strict: true as an action input to fail on any vulnerability:

- uses: fluidattacks/sast-action@<version>
  with:
    strict: true

To break the build only for vulnerabilities at or above a severity that you set, use strictness_threshold (low, medium, high, or critical). It breaks the build by itself, with or without strict. The scan reports all the vulnerabilities and fails only for those that reach the threshold:

- uses: fluidattacks/sast-action@<version>
  with:
    strictness_threshold: high

You can set the two values also in your configuration file. These rules apply:

  • The action inputs override the configuration file, including strict: false over a file that says true. If you omit an input, the configuration file decides.
  • In an authenticated run, the minimum CVSS score of your group on the platform also applies. If a policy and strictness_threshold exist, the stricter of the two applies. Thus, the workflow can only make the gate stricter than the platform, never less strict.
  • The action ignores an invalid value and shows a warning. Then, the configuration file decides.

Then, in the branch protection settings of your repository, enable Require status checks to pass before merging.

Export results as CSV or SARIF

Use output.file_path and output.format in your configuration file to write results to a file:

output:
  file_path: results.sarif
  format: SARIF

The correct values for format are SARIF, CSV, and ALL (generates the two formats at the same time). The action sets the sarif_file output only when the format is SARIF or ALL.

Troubleshooting

The pipeline fails unexpectedly

If you set strict: true or strictness_threshold (as an action input or in your configuration file), the pipeline fails when the scanner finds vulnerabilities, or ones at or above the threshold. Remove them, or raise strictness_threshold, to report findings without a pipeline failure. The action input wins over the configuration file.

The job fails with "not found in repository"

The path in scan_config_path does not exist in the repository. Make sure that the path is correct and relative to the repository root.

No results appear in the Security tab

Make sure that the upload step uses if: always(). Thus, it runs also when the scan finds vulnerabilities with strict: true. Also make sure that your repository has GitHub Advanced Security enabled. For more information, read GitHub Advanced Security.

Differential scan analyzes all files instead of just changes

Make sure that you set scanner_mode: diff and that the actions/checkout step sets fetch-depth: 0. Without the full git history, the action cannot find which files changed relative to the default branch.

On this page