File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -148,18 +148,28 @@ jobs:
148148 name : DAST - OWASP ZAP baseline
149149 runs-on : ubuntu-latest
150150 needs : prepare
151- if : ${{ secrets.STAGING_URL != '' }}
152151 steps :
153152 - uses : actions/checkout@v4
154153
154+ - name : Check if STAGING_URL is set
155+ id : check_url
156+ run : |
157+ if [ -n "${{ secrets.STAGING_URL }}" ]; then
158+ echo "url_exists=true" >> $GITHUB_OUTPUT
159+ else
160+ echo "url_exists=false" >> $GITHUB_OUTPUT
161+ echo "STAGING_URL not set, skipping ZAP scan"
162+ fi
163+
155164 - name : Run ZAP baseline scan
165+ if : steps.check_url.outputs.url_exists == 'true'
156166157167 with :
158168 target : ${{ secrets.STAGING_URL }}
159169 rules_file_name : zap-rules.md
160170
161171 - name : Upload ZAP artifacts
162- if : always()
172+ if : always() && steps.check_url.outputs.url_exists == 'true'
163173 uses : actions/upload-artifact@v4
164174 with :
165175 name : zap-output
You can’t perform that action at this time.
0 commit comments