Skip to content

Commit

Permalink
feat: Simplify setup of Debricked scans on FoD
Browse files Browse the repository at this point in the history
  • Loading branch information
rsenden committed Oct 30, 2024
1 parent 2b9075b commit 9a9656f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
2 changes: 2 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ runs:
steps:
- uses: fortify/github-action/fod-sast-scan@main
if: inputs['sast-scan']=='true' && env.FOD_URL
env:
DO_DEBRICKED_SCAN: ${{ inputs['debricked-sca-scan'] }}
- uses: fortify/github-action/sc-sast-scan@main
if: inputs['sast-scan']=='true' && env.SSC_URL
env:
Expand Down
17 changes: 16 additions & 1 deletion internal/set-fod-var-defaults/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ author: 'Fortify'
runs:
using: composite
steps:
- if: ${{ !env.FOD_RELEASE }}
- name: Set default FoD release name
if: ${{ !env.FOD_RELEASE }}
run: |
export FOD_RELEASE="${APP}:${REL}"
echo FOD_RELEASE=$FOD_RELEASE >> $GITHUB_ENV
Expand All @@ -13,6 +14,20 @@ runs:
env:
APP: ${{ github.repository }}
REL: ${{ github.head_ref || github.ref_name }}
- name: Configure --oss setup / -oss package options if Debricked scan enabled
if: ${{ env.DO_DEBRICKED_SCAN=='true' }}
run: |
# Platform-independent regexes looking for -oss/--oss options with word boundaries
# See 'Optional reading' section at https://stackoverflow.com/a/12696899
PKG_REGEX="(^|[^[:alnum:]_])-oss([^[:alnum:]_]|$)"
SETUP_REGEX="(^|[^[:alnum:]_])--oss([^[:alnum:]_]|$)"
if [[ ! $EXTRA_PACKAGE_OPTS =~ $PKG_REGEX && ! $PACKAGE_EXTRA_OPTS =~ $PKG_REGEX ]]; then
echo "PACKAGE_EXTRA_OPTS=-oss $PACKAGE_EXTRA_OPTS" >> $GITHUB_ENV
fi
if [[ ! $SETUP_EXTRA_OPTS =~ $SETUP_REGEX ]]; then
echo "SETUP_EXTRA_OPTS=--oss $SETUP_EXTRA_OPTS" >> $GITHUB_ENV
fi
shell: bash

branding:
icon: 'shield'
Expand Down
1 change: 1 addition & 0 deletions package/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ author: 'Fortify'
runs:
using: composite
steps:
- uses: fortify/github-action/internal/set-fod-var-defaults@main
- uses: fortify/github-action/internal/setup-java-for-sc-client@main
- uses: fortify/github-action/setup@main
with:
Expand Down

0 comments on commit 9a9656f

Please sign in to comment.