<commit_before>name: Main workflow
on: [push, pull_request]
jobs:
  build:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        java: [8, 11, 15]
    steps:
    - name: Checkout
      uses: actions/checkout@v2
      with:
        fetch-depth: 0  # Shallow clones should be disabled for a better relevancy of analysis
    - name: Set up JDK
      uses: actions/setup-java@v2
      with:
        distribution: 'zulu'
        java-version: ${{ matrix.java }}
    - name: Cache SonarCloud packages
      uses: actions/cache@v2.1.5
      if: matrix.java == '11'
      with:
        path: ~/.sonar/cache
        key: ${{ runner.os }}-sonar
        restore-keys: ${{ runner.os }}-sonar
    - name: Cache Maven packages
      uses: actions/cache@v2.1.5
      with:
        path: ~/.m2
        key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
        restore-keys: ${{ runner.os }}-m2
    - name: Build
      run: ./mvnw -V -B -ntp install
    - name: Analyze with SonarCloud
      if: matrix.java == '11'
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}  # Needed to get PR information, if any
        SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
      run: ./mvnw -V -B -ntp org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
<commit_msg>Only run SonarCloud analysis with SONAR_TOKEN<commit_after>name: Main workflow
on: [push, pull_request]
jobs:
  build:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        java: [8, 11, 15]
    steps:
    - name: Checkout
      uses: actions/checkout@v2
      with:
        fetch-depth: 0  # Shallow clones should be disabled for a better relevancy of analysis
    - name: Set up JDK
      uses: actions/setup-java@v2
      with:
        distribution: 'zulu'
        java-version: ${{ matrix.java }}
    - name: Cache SonarCloud packages
      uses: actions/cache@v2.1.5
      if: ${{ env.SONAR_TOKEN != null && env.SONAR_TOKEN != '' && matrix.java_version == '11' }}
      env:
        SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
      with:
        path: ~/.sonar/cache
        key: ${{ runner.os }}-sonar
        restore-keys: ${{ runner.os }}-sonar
    - name: Cache Maven packages
      uses: actions/cache@v2.1.5
      with:
        path: ~/.m2
        key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
        restore-keys: ${{ runner.os }}-m2
    - name: Build
      run: ./mvnw -V -B -ntp install
    - name: Analyze with SonarCloud
      if: ${{ env.SONAR_TOKEN != null && env.SONAR_TOKEN != '' && matrix.java_version == '11' }}
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}  # Needed to get PR information, if any
        SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
      run: ./mvnw -V -B -ntp org.sonarsource.scanner.maven:sonar-maven-plugin:sonar

{'fraction_non_alphanumeric': 0.14145096609551586, 'fraction_numerical': 0.015311702515493984, 'mean_word_length': 2.146788990825688, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1848021', 'n_tokens_mistral': 977, 'n_tokens_neox': 945, 'n_words': 240}