@@ -618,4 +618,39 @@ jobs:
618
618
projectBaseDir : ./test/example-project
619
619
- name : Assert failure of previous step
620
620
if : steps.wrong_ssl_certificate.outcome == 'success'
621
- run : exit 1
621
+ run : exit 1
622
+ overridesScannerLocalFolderWhenPresent :
623
+ name : >
624
+ 'SCANNER_LOCAL_FOLDER' is overridden with warning when present
625
+ runs-on : ubuntu-latest
626
+ steps :
627
+ - uses : actions/checkout@v4
628
+ with :
629
+ token : ${{ secrets.GITHUB_TOKEN }}
630
+ - name : Create a dummy SCANNER_LOCAL_FOLDER with dummy content in it
631
+ run : |
632
+ SCANNER_VERSION="6.2.1.4610"
633
+ SCANNER_LOCAL_FOLDER="$RUNNER_TEMP/sonar-scanner-cli-$SCANNER_VERSION-$RUNNER_OS-$RUNNER_ARCH"
634
+ # emit SCANNER_VERSION and SCANNER_LOCAL_FOLDER to be able to read them in the next steps
635
+ echo "SCANNER_VERSION=$SCANNER_VERSION" >> $GITHUB_ENV
636
+ echo "SCANNER_LOCAL_FOLDER=$SCANNER_LOCAL_FOLDER" >> $GITHUB_ENV
637
+ mkdir -p "$SCANNER_LOCAL_FOLDER"
638
+ touch "$SCANNER_LOCAL_FOLDER/some_content.txt"
639
+ - name : Assert SCANNER_LOCAL_FOLDER exists and dummy file is in it
640
+ run : |
641
+ [ -d "$SCANNER_LOCAL_FOLDER" ] || exit 1
642
+ [ -f "$SCANNER_LOCAL_FOLDER/some_content.txt" ] || exit 1
643
+ - name : Run action with SONAR_SCANNER_TEMP
644
+ uses : ./
645
+ env :
646
+ SONAR_SCANNER_TEMP : /tmp/sonar-scanner
647
+ SONAR_HOST_URL : http://not_actually_used
648
+ NO_CACHE : true # force install-sonar-scanner-cli.sh execution
649
+ with :
650
+ args : -Dsonar.scanner.internal.dumpToFile=./output.properties
651
+ scannerVersion : ${{ env.SCANNER_VERSION }}
652
+ - name : Assert SCANNER_LOCAL_FOLDER exists and dummy file is not in it
653
+ run : |
654
+ [ -d "$SCANNER_LOCAL_FOLDER" ] || exit 1
655
+ [ ! -f "$SCANNER_LOCAL_FOLDER/some_content.txt" ] || exit 1
656
+
0 commit comments