|
| 1 | +# By default this workflow will be running for PRs (rapid scans) and on push to main branch (full scan) |
| 2 | +on: |
| 3 | + pull_request_target: |
| 4 | + types: [labeled] |
| 5 | + pull_request: |
| 6 | + branches: [main] |
| 7 | + push: |
| 8 | + branches: [main] |
| 9 | +jobs: |
| 10 | + sca-full: |
| 11 | + runs-on: sca |
| 12 | + if: github.event_name == 'push' |
| 13 | + steps: |
| 14 | + - name: Checkout |
| 15 | + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1 |
| 16 | + # Checking out SCA composite action |
| 17 | + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1 |
| 18 | + with: |
| 19 | + repository: NordSecurity/sca-configs |
| 20 | + ref: main |
| 21 | + ssh-key: ${{ secrets.SCA_ACTION_KEY }} |
| 22 | + path: .github/workflows/sca |
| 23 | + # Checking out only SCA action and composite project configuration action |
| 24 | + sparse-checkout: | |
| 25 | + base/sca-action |
| 26 | + SCA/nordsecurity-storyblok-rich-text-astro-renderer-sca-action |
| 27 | + - uses: ./.github/workflows/sca/SCA/nordsecurity-storyblok-rich-text-astro-renderer-sca-action |
| 28 | + with: |
| 29 | + SCA_URL: ${{ secrets.SCA_URL }} |
| 30 | + SCA_API_TOKEN: ${{ secrets.SCA_API_TOKEN }} |
| 31 | + SCA_FULL_SCAN: true |
| 32 | + sca-rapid: |
| 33 | + runs-on: sca |
| 34 | + if: | |
| 35 | + ( |
| 36 | + github.event_name == 'pull_request' && |
| 37 | + github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name |
| 38 | + ) || |
| 39 | + ( |
| 40 | + github.event_name == 'pull_request_target' && |
| 41 | + github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name && |
| 42 | + github.event.label.name == 'security scan' |
| 43 | + ) |
| 44 | + steps: |
| 45 | + - name: Checkout |
| 46 | + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1 |
| 47 | + # Checking out SCA composite action |
| 48 | + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1 |
| 49 | + with: |
| 50 | + repository: NordSecurity/sca-configs |
| 51 | + ref: main |
| 52 | + ssh-key: ${{ secrets.SCA_ACTION_KEY }} |
| 53 | + path: .github/workflows/sca |
| 54 | + # Checking out only SCA action and composite project configuration action |
| 55 | + sparse-checkout: | |
| 56 | + base/sca-action |
| 57 | + SCA/nordsecurity-storyblok-rich-text-astro-renderer-sca-action |
| 58 | + - uses: ./.github/workflows/sca/SCA/nordsecurity-storyblok-rich-text-astro-renderer-sca-action |
| 59 | + with: |
| 60 | + SCA_URL: ${{ secrets.SCA_URL }} |
| 61 | + SCA_API_TOKEN: ${{ secrets.SCA_API_TOKEN }} |
| 62 | + SCA_FULL_SCAN: false |
0 commit comments