Update main.yml #28
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow uses actions that are not certified by GitHub. | |
# They are provided by a third-party and are governed by | |
# separate terms of service, privacy policy, and support | |
# documentation. | |
# JFrog SAST performs 1st party source code security analysis | |
# For more information, see | |
# https://docs.jfrog-applications.jfrog.io/jfrog-security-features/sast | |
name: "JFrog SAST Scan" | |
on: | |
push: | |
pull_request: | |
schedule: | |
- cron: '39 23 * * 6' | |
workflow_dispatch: | |
env: | |
# [Mandatory] | |
# JFrog platform URL and access token for | |
# a JFrog platform instance with active | |
# JFrog Advanced Security subscription | |
JF_URL: https://${{ vars.JF_URL }}/ | |
JF_TOKEN: ${{ secrets.JF_ACCESS_TOKEN }} | |
jobs: | |
analyze: | |
name: Analyze | |
runs-on: ubuntu-latest | |
permissions: | |
actions: read | |
contents: read | |
security-events: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
- name: Install and configure JFrog CLI | |
run: | | |
npm install -g jfrog-cli-v2-jf | |
echo $JF_TOKEN | jf c add --interactive=false --url=$JF_URL --access-token-stdin | |
- name: Run JFrog SAST | |
run: | | |
jf -v | |
jf audit --sast --format=sarif > jfrog_sast.sarif | |
- name: Temporary - adjust tool name in SARIF | |
# Temporary workaround until autofix deploys a new version that recognises all variants of the JFrog tool name, | |
# including the variant with the frog emoji | |
run: | | |
cat jfrog.sarif | jq '.runs[0].tool.driver.name = "JFrog SAST"' > jfrog.sarif.tmp | |
mv jfrog.sarif.tmp jfrog.sarif | |
- name: Pretty print SARIF | |
run: cat jfrog.sarif | jq . | |
- name: Upload output to generate autofix | |
uses: github/codeql-action/upload-sarif@v3 | |
with: | |
sarif_file: jfrog_sast.sarif |