@@ -619,9 +619,9 @@ jobs:
619
619
- name : Assert failure of previous step
620
620
if : steps.wrong_ssl_certificate.outcome == 'success'
621
621
run : exit 1
622
- overridesScannerLocalFolderWhenPresent :
622
+ overridesScannerLocalFolderWhenPresent : # can happen in uncleaned self-hosted runners
623
623
name : >
624
- 'SCANNER_LOCAL_FOLDER' is overridden with warning when present
624
+ 'SCANNER_LOCAL_FOLDER' is cleaned with warning when present
625
625
runs-on : ubuntu-latest
626
626
steps :
627
627
- uses : actions/checkout@v4
@@ -643,14 +643,142 @@ jobs:
643
643
- name : Run action with SONAR_SCANNER_TEMP
644
644
uses : ./
645
645
env :
646
+ NO_CACHE : true # force install-sonar-scanner-cli.sh execution
646
647
SONAR_SCANNER_TEMP : /tmp/sonar-scanner
647
648
SONAR_HOST_URL : http://not_actually_used
648
- NO_CACHE : true # force install-sonar-scanner-cli.sh execution
649
649
with :
650
650
args : -Dsonar.scanner.internal.dumpToFile=./output.properties
651
651
scannerVersion : ${{ env.SCANNER_VERSION }}
652
652
- name : Assert SCANNER_LOCAL_FOLDER exists and dummy file is not in it
653
653
run : |
654
654
[ -d "$SCANNER_LOCAL_FOLDER" ] || exit 1
655
655
[ ! -f "$SCANNER_LOCAL_FOLDER/some_content.txt" ] || exit 1
656
-
656
+ updateTruststoreWhenPresent : # can happen in uncleaned self-hosted runners
657
+ name : >
658
+ truststore.p12 is updated when present
659
+ runs-on : ubuntu-latest
660
+ steps :
661
+ - uses : actions/checkout@v4
662
+ with :
663
+ token : ${{ secrets.GITHUB_TOKEN }}
664
+ - name : Create SONAR_SSL_FOLDER with a file in it (not-truststore.p12)
665
+ run : |
666
+ SONAR_SSL_FOLDER=~/.sonar/ssl
667
+ mkdir -p "$SONAR_SSL_FOLDER"
668
+ touch "$SONAR_SSL_FOLDER/not-truststore.p12"
669
+ # emit SONAR_SSL_FOLDER to be able to read it in the next steps
670
+ echo "SONAR_SSL_FOLDER=$SONAR_SSL_FOLDER" >> $GITHUB_ENV
671
+ - name : Assert truststore.p12 does not file exists
672
+ run : |
673
+ [ ! -f "$SONAR_SSL_FOLDER/truststore.p12" ] || exit 1
674
+ - name : Run action with SONAR_ROOT_CERT
675
+ uses : ./
676
+ env :
677
+ # NO_CACHE not needed, as SONAR_SSL_FOLDER is setup when the Sonar Scanner is run, not installed
678
+ SONAR_HOST_URL : http://not_actually_used
679
+ SONAR_ROOT_CERT : |
680
+ -----BEGIN CERTIFICATE-----
681
+ MIIFlTCCA32gAwIBAgIUXK4LyGUFe4ZVL93StPXCoJzmnLMwDQYJKoZIhvcNAQEL
682
+ BQAwTzELMAkGA1UEBhMCQ0gxDzANBgNVBAgMBkdlbmV2YTEPMA0GA1UEBwwGR2Vu
683
+ ZXZhMQ8wDQYDVQQKDAZTZXJ2ZXIxDTALBgNVBAsMBERlcHQwHhcNMjQxMTAxMDgx
684
+ MzM3WhcNMzQxMDMwMDgxMzM3WjBPMQswCQYDVQQGEwJDSDEPMA0GA1UECAwGR2Vu
685
+ ZXZhMQ8wDQYDVQQHDAZHZW5ldmExDzANBgNVBAoMBlNlcnZlcjENMAsGA1UECwwE
686
+ RGVwdDCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAK5m0V6IFFykib77
687
+ nmlN7weS9q3D6YGEj+8hRNQViL9KduUoLjoKpONIihU5kfIg+5SkGygjHRkBvIp3
688
+ b0HQqhkwtGln3/FxxaSfGEguLHgzXR8JDQSyJ8UKIGOPCH93n1rUip5Ok1iExVup
689
+ HtkiVDRoCC9cRjZXbGOKrO6VBT4RvakpkaqCdXYikV244B5ElM7kdFdz8fso78Aq
690
+ xekb9dM0f21uUaDBKCIhRcxWeafp0CJIoejTq0+PF7qA2qIY5UHqWElWO5NsvQ8+
691
+ MqKkIdsOa1pYNuH/5eQ59k9KSE92ps1xTKweW000GfPqxx8IQ/e4aAd2SaMTKvN6
692
+ aac6piWBeJ7AssgWwkg/3rnZB5seQIrWjIUePmxJ4c0g0eL9cnVpYF0K/Dldle/G
693
+ wg0z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jjEbAdA6jM9PMiXzuDukldm
709
+ QBRwNbczGbdsHkMKHmQnrTqOyQyI4KCXF08kcOm4C1P+Whrvi0DXkqHnyKvBE0td
710
+ dciInBoeHwUs2eclz7gP7pMBJUlFUkKfQxwxGLIqZSXnlAFBfW6hHLI=
711
+ -----END CERTIFICATE-----
712
+ with :
713
+ args : -Dsonar.scanner.internal.dumpToFile=./output.properties
714
+ - name : Assert not-truststore.p12 file still exists
715
+ run : |
716
+ [ -f "$SONAR_SSL_FOLDER/not-truststore.p12" ] || exit 1
717
+ - name : Assert truststore.p12 file now exists and take note of modification time
718
+ run : |
719
+ [ -f "$SONAR_SSL_FOLDER/truststore.p12" ] || exit 1
720
+ # emit the modification time of the truststore.p12 file to be able to read it in the next steps
721
+ TRUSTSTORE_P12_MOD_TIME_T1=$(stat -c %Y "$SONAR_SSL_FOLDER/truststore.p12")
722
+ echo "TRUSTSTORE_P12_MOD_TIME_T1=$TRUSTSTORE_P12_MOD_TIME_T1" >> $GITHUB_ENV
723
+ - name : Run action a second time with a different SONAR_ROOT_CERT
724
+ uses : ./
725
+ env :
726
+ # NO_CACHE not needed, as SONAR_SSL_FOLDER is setup when the Sonar Scanner is run, not installed
727
+ SONAR_HOST_URL : http://not_actually_used
728
+ SONAR_ROOT_CERT : |
729
+ -----BEGIN CERTIFICATE-----
730
+ MIICgTCCAeoCCQCbOlrWDdX7FTANBgkqhkiG9w0BAQUFADCBhDELMAkGA1UEBhMC
731
+ Tk8xGDAWBgNVBAgTD0FuZHJlYXMgU29sYmVyZzEMMAoGA1UEBxMDRm9vMRAwDgYD
732
+ VQQKEwdVTklORVRUMRgwFgYDVQQDEw9mZWlkZS5lcmxhbmcubm8xITAfBgkqhkiG
733
+ 9w0BCQEWEmFuZHJlYXNAdW5pbmV0dC5ubzAeFw0wNzA2MTUxMjAxMzVaFw0wNzA4
734
+ MTQxMjAxMzVaMIGEMQswCQYDVQQGEwJOTzEYMBYGA1UECBMPQW5kcmVhcyBTb2xi
735
+ ZXJnMQwwCgYDVQQHEwNGb28xEDAOBgNVBAoTB1VOSU5FVFQxGDAWBgNVBAMTD2Zl
736
+ aWRlLmVybGFuZy5ubzEhMB8GCSqGSIb3DQEJARYSYW5kcmVhc0B1bmluZXR0Lm5v
737
+ MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDivbhR7P516x/S3BqKxupQe0LO
738
+ NoliupiBOesCO3SHbDrl3+q9IbfnfmE04rNuMcPsIxB161TdDpIesLCn7c8aPHIS
739
+ KOtPlAeTZSnb8QAu7aRjZq3+PbrP5uW3TcfCGPtKTytHOge/OlJbo078dVhXQ14d
740
+ 1EDwXJW1rRXuUt4C8QIDAQABMA0GCSqGSIb3DQEBBQUAA4GBACDVfp86HObqY+e8
741
+ BUoWQ9+VMQx1ASDohBjwOsg2WykUqRXF+dLfcUH9dWR63CtZIKFDbStNomPnQz7n
742
+ bK+onygwBspVEbnHuUihZq3ZUdmumQqCw4Uvs/1Uvq3orOo/WJVhTyvLgFVK2Qar
743
+ Q4/67OZfHd7R+POBXhophSMv1ZOo
744
+ -----END CERTIFICATE-----
745
+ with :
746
+ args : -Dsonar.scanner.internal.dumpToFile=./output.properties
747
+ - name : Assert truststore.p12 still exists, but it has been updated, and take note of modification time
748
+ run : |
749
+ [ -f "$SONAR_SSL_FOLDER/truststore.p12" ] || exit 1
750
+ TRUSTSTORE_P12_MOD_TIME_T2=$(stat -c %Y "$SONAR_SSL_FOLDER/truststore.p12")
751
+ [ "$TRUSTSTORE_P12_MOD_TIME_T1" != "$TRUSTSTORE_P12_MOD_TIME_T2" ] || exit 1
752
+ # emit the modification time of the truststore.p12 file to be able to read it in the next steps
753
+ echo "TRUSTSTORE_P12_MOD_TIME_T2=$TRUSTSTORE_P12_MOD_TIME_T2" >> $GITHUB_ENV
754
+ - name : Remove sonar alias from truststore.p12
755
+ run : keytool -delete -alias sonar -keystore "$SONAR_SSL_FOLDER/truststore.p12" -storepass changeit
756
+ - name : Run action a third time
757
+ uses : ./
758
+ env :
759
+ # NO_CACHE not needed, as SONAR_SSL_FOLDER is setup when the Sonar Scanner is run, not installed
760
+ SONAR_HOST_URL : http://not_actually_used
761
+ SONAR_ROOT_CERT : |
762
+ -----BEGIN CERTIFICATE-----
763
+ MIICgTCCAeoCCQCbOlrWDdX7FTANBgkqhkiG9w0BAQUFADCBhDELMAkGA1UEBhMC
764
+ Tk8xGDAWBgNVBAgTD0FuZHJlYXMgU29sYmVyZzEMMAoGA1UEBxMDRm9vMRAwDgYD
765
+ VQQKEwdVTklORVRUMRgwFgYDVQQDEw9mZWlkZS5lcmxhbmcubm8xITAfBgkqhkiG
766
+ 9w0BCQEWEmFuZHJlYXNAdW5pbmV0dC5ubzAeFw0wNzA2MTUxMjAxMzVaFw0wNzA4
767
+ MTQxMjAxMzVaMIGEMQswCQYDVQQGEwJOTzEYMBYGA1UECBMPQW5kcmVhcyBTb2xi
768
+ ZXJnMQwwCgYDVQQHEwNGb28xEDAOBgNVBAoTB1VOSU5FVFQxGDAWBgNVBAMTD2Zl
769
+ aWRlLmVybGFuZy5ubzEhMB8GCSqGSIb3DQEJARYSYW5kcmVhc0B1bmluZXR0Lm5v
770
+ MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDivbhR7P516x/S3BqKxupQe0LO
771
+ NoliupiBOesCO3SHbDrl3+q9IbfnfmE04rNuMcPsIxB161TdDpIesLCn7c8aPHIS
772
+ KOtPlAeTZSnb8QAu7aRjZq3+PbrP5uW3TcfCGPtKTytHOge/OlJbo078dVhXQ14d
773
+ 1EDwXJW1rRXuUt4C8QIDAQABMA0GCSqGSIb3DQEBBQUAA4GBACDVfp86HObqY+e8
774
+ BUoWQ9+VMQx1ASDohBjwOsg2WykUqRXF+dLfcUH9dWR63CtZIKFDbStNomPnQz7n
775
+ bK+onygwBspVEbnHuUihZq3ZUdmumQqCw4Uvs/1Uvq3orOo/WJVhTyvLgFVK2Qar
776
+ Q4/67OZfHd7R+POBXhophSMv1ZOo
777
+ -----END CERTIFICATE-----
778
+ with :
779
+ args : -Dsonar.scanner.internal.dumpToFile=./output.properties
780
+ - name : Assert truststore.p12 still exists, and it has been updated again
781
+ run : |
782
+ [ -f "$SONAR_SSL_FOLDER/truststore.p12" ] || exit 1
783
+ TRUSTSTORE_P12_MOD_TIME_T3=$(stat -c %Y "$SONAR_SSL_FOLDER/truststore.p12")
784
+ [ "$TRUSTSTORE_P12_MOD_TIME_T2" != "$TRUSTSTORE_P12_MOD_TIME_T3" ] || exit 1
0 commit comments