Skip to content


Use this GitHub Action with your project

Add this Action to an existing workflow or create a new one.

View on Marketplace
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?


Failed to load latest commit information.
Latest commit message
Commit time
April 23, 2021 16:24
April 6, 2021 13:42
April 6, 2021 13:42
April 7, 2021 13:57
October 30, 2023 15:47

HCL AppScan CodeSweep Github Action

Your GitHub code is better and more secure with HCL AppScan CodeSweep for GitHub. For free.

The HCL AppScan CodeSweep GitHub Action enables you to check your code on every pull request. The action identifies vulnerabilities in changed code with every update. But more than just identifying issues, the HCL AppScan CodeSweep GitHub Action tells you what you need to know to mitigate issues — before they make it to the main branch.



Register on HCL AppScan on Cloud (ASoC) to generate your API key/secret.


  1. After logging into ASoC, go to the API page to generate your API key/secret pair. These must be used in the asoc_key and asoc_secret parameters for the action. It's recommended to store them as secrets in your repository. adingkeys_animation
  2. Ensure that the "Workflow permissions" for your repository are set to "Read and write permissions". This allows Codesweep to scan your files and create checkruns and annotations for the issues it finds. You can access these settings by going to Settings -> Actions -> General.
  3. To scan code changes when a pull request is opened, add the following file to your repository under .github/workflows/codesweep.yml or update an existing workflow file:
name: "HCL AppScan CodeSweep"
    types: [opened,synchronize]
    runs-on: ubuntu-latest
      - name: Checkout
        uses: actions/checkout@v1
      - name: Run AppScan CodeSweep
        uses: HCL-TECH-SOFTWARE/appscan-codesweep-action@v2
          asoc_key: ${{secrets.ASOC_KEY}}
          asoc_secret: ${{secrets.ASOC_SECRET}}
      GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

Note If you use checkout@v2 or later you must set fetch-depth to 0. For example:

uses: actions/checkout@v2
  fetch-depth: 0
  1. To publish security issues to ASoC when a pull request is merged, add the following file to your repository under .github/workflows/codesweep_publish.yml or update an existing workflow file:
name: "HCL AppScan CodeSweep"
    types: [closed]
    runs-on: ubuntu-latest
      - name: Publish issues to ASoC
        uses: HCL-TECH-SOFTWARE/appscan-codesweep-action@v2
          asoc_key: ${{secrets.ASOC_KEY}}
          asoc_secret: ${{secrets.ASOC_SECRET}}
          publish_on_merge: true
          application_id: <your ASoC application ID>
      GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

Optional Parameters For Scanning

  • status - The status of the checks if any security issues are found. Must be one of 'action_required', 'failure', or 'neutral'. The default is neutral. For example:
  status: failure
  • service_url - The url of the AppScan service when connecting to AppScan 360.
  • acceptssl - Allow connections to an AppScan service with an untrusted certificate. Recommended for testing purposes only.

Optional Parameters For Publishing Issues to AppScan on Cloud

  • issue_status - The status of issues that are published to ASoC. Must be one of 'open', 'inprogress', 'noise', 'fixed', or 'passed'. The default is 'open'.
  • scan_base_name - The base name of the scan for issues published to ASoC. A timestamp is appended to the given base name. The default is 'GitHub_CodeSweep'.
  • personal_scan - When issues are published to ASoC, the scan representing those issues can be made a personal scan. The default is false.
  publish_on_merge: true
  application_id: 6c058381-17ca-e711-8de5-002590ac753d
  issue_status: "inprogress"
  scan_base_name: "CodeSweep"
  personal_scan: true


Annotations are added to the diff view, showing any vulnerable lines of code and a checkrun is added to provide additional details, including good and bad code samples and mitigation information. annotation_screenshot

Supported Languages

The HCL AppScan CodeSweep action supports scanning the following languages/dialects:

Android-Java NodeJS
Angular Objective-C/Objective-C++
Apex PHP
Cobol Perl
ColdFusion Python
Dart React
Golang React Native
Groovy Ruby
IaC (Docker, K8s, Terraform) Scala
Ionic Swift
Java T-SQL
JavaScript TypeScript
JQuery VueJS
Kotlin .Net (C#, VB.NET, ASP.Net)
MooTools Xamarin

Join the community

Use the CodeSweep slack channel to report any feedback or ask general questions about the HCL AppScan CodeSweep action.


  • Problem: The security scan runs, but no checkruns or annotations are created for the security issues that are found. The workflow log contains the error: Error: Failed creating checkrun: HttpError: Resource not accessible by integration

    This error indicates that the workflow does not have write permission to the repository, so CodeSweep is unable to create the checkruns and annotations. To fix this, go to Settings -> Actions -> General and set Workflow permissions to Read and write permissions.