How to Tag NG SAST Results with the Git Branch Name

ShiftLeft CORE's NG SAST allows you to provide branch names so that you can distinguish analysis results for one branch from another.

To include branch in formation in the results generated by NG SAST:

  1. Obtain the branch name from your version control system. For example, Git allows you to do this using git symbolic-ref --short HEAD.

  2. Add the branch name you obtained in the previous step to the script you use to automate the running of NG-SAST using the --tag option (i.e., sl analyze --tag branch=`git symbolic-ref --short HEAD`)

If you're working in a GitHub environment (e.g., GitHub Actions), you can also use --tag branch=${{ github.head_ref }} to populate your branch name.

At this point, ShiftLeft will include the branch name when displaying results from your code analyses in the Dashboard.

Image of the Version Menu