File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515 shell : bash
1616 if : steps.check.outputs.secret_exist == 'true'
1717 run : |
18+ export BRANCH_NAME=${GITHUB_HEAD_REF:-$(echo $GITHUB_REF | sed 's#refs/heads/##')}
1819 export SONAR_TOKEN=${{ inputs.sonar_token }}
1920 ./scripts/reports/perform-static-analysis.sh
Original file line number Diff line number Diff line change 2424 steps :
2525 - name : " Generate SBOM"
2626 shell : bash
27- run : BUILD_DATETIME=${{ inputs.build_datetime }} ./scripts/reports/generate-sbom.sh
27+ run : |
28+ export BUILD_DATETIME=${{ inputs.build_datetime }}
29+ ./scripts/reports/generate-sbom.sh
2830 - name : " Compress SBOM report"
2931 shell : bash
3032 run : zip sbom-report.json.zip sbom-report.json
3537 path : ./sbom-report.json.zip
3638 - name : " Scan vulnerabilities"
3739 shell : bash
38- run : BUILD_DATETIME=${{ inputs.build_datetime }} ./scripts/reports/scan-vulnerabilities.sh
40+ run : |
41+ export BUILD_DATETIME=${{ inputs.build_datetime }}
42+ ./scripts/reports/scan-vulnerabilities.sh
3943 - name : " Compress vulnerabilities report"
4044 shell : bash
4145 run : zip vulnerabilities-report.json.zip vulnerabilities-report.json
Original file line number Diff line number Diff line change 99# $ ./perform-static-analysis.sh
1010#
1111# Expects:
12- # SONAR_TOKEN=token # SonarCloud token
12+ # BRANCH_NAME=branch-name # Branch to report on
13+ # SONAR_TOKEN=token # SonarCloud token
1314#
1415# Options:
1516# VERBOSE=true # Show all the executed commands, default is `false`
@@ -33,7 +34,7 @@ function create-report() {
3334 --volume $PWD :/usr/src \
3435 sonarsource/sonar-scanner-cli:$image_version \
3536 -Dproject.settings=/usr/src/scripts/config/sonar-scanner.properties \
36- -Dsonar.branch.name=" $( git rev-parse --abbrev-ref HEAD) " \
37+ -Dsonar.branch.name=" ${BRANCH_NAME :- $ (git rev-parse --abbrev-ref HEAD)} " \
3738 -Dsonar.token=" $( echo $SONAR_TOKEN ) "
3839}
3940
You can’t perform that action at this time.
0 commit comments