|
| 1 | +# This workflow uses actions that are not certified by GitHub. |
| 2 | +# They are provided by a third-party and are governed by |
| 3 | +# separate terms of service, privacy policy, and support |
| 4 | +# documentation. |
| 5 | + |
| 6 | +# This workflow integrates a collection of open source static analysis tools |
| 7 | +# with GitHub code scanning. For documentation, or to provide feedback, visit |
| 8 | +# https://github.com/github/ossar-action |
| 9 | +name: OSSAR |
| 10 | + |
| 11 | +on: |
| 12 | + push: |
| 13 | + branches: [ "main" ] |
| 14 | + pull_request: |
| 15 | + # The branches below must be a subset of the branches above |
| 16 | + branches: [ "main" ] |
| 17 | + schedule: |
| 18 | + - cron: '20 11 * * 0' |
| 19 | + |
| 20 | +permissions: |
| 21 | + contents: read |
| 22 | + |
| 23 | +jobs: |
| 24 | + OSSAR-Scan: |
| 25 | + # OSSAR runs on windows-latest. |
| 26 | + # ubuntu-latest and macos-latest support coming soon |
| 27 | + permissions: |
| 28 | + contents: read # for actions/checkout to fetch code |
| 29 | + security-events: write # for github/codeql-action/upload-sarif to upload SARIF results |
| 30 | + actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status |
| 31 | + runs-on: windows-latest |
| 32 | + |
| 33 | + steps: |
| 34 | + - name: Checkout repository |
| 35 | + uses: actions/checkout@v4 |
| 36 | + |
| 37 | + # Ensure a compatible version of dotnet is installed. |
| 38 | + # The [Microsoft Security Code Analysis CLI](https://aka.ms/mscadocs) is built with dotnet v3.1.201. |
| 39 | + # A version greater than or equal to v3.1.201 of dotnet must be installed on the agent in order to run this action. |
| 40 | + # GitHub hosted runners already have a compatible version of dotnet installed and this step may be skipped. |
| 41 | + # For self-hosted runners, ensure dotnet version 3.1.201 or later is installed by including this action: |
| 42 | + # - name: Install .NET |
| 43 | + # uses: actions/setup-dotnet@v4 |
| 44 | + # with: |
| 45 | + # dotnet-version: '3.1.x' |
| 46 | + |
| 47 | + # Run open source static analysis tools |
| 48 | + - name: Run OSSAR |
| 49 | + uses: github/ossar-action@v1 |
| 50 | + id: ossar |
| 51 | + |
| 52 | + # Upload results to the Security tab |
| 53 | + - name: Upload OSSAR results |
| 54 | + uses: github/codeql-action/upload-sarif@v3 |
| 55 | + with: |
| 56 | + sarif_file: ${{ steps.ossar.outputs.sarifFile }} |
0 commit comments