<commit_before>name: GitHub Actions CI
on:
  push:
    branches: master
  pull_request: []
  release:
    types:
      - published
jobs:
  tests:
    if: github.repository == 'Homebrew/brew'
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest, macOS-latest]
    steps:
    - name: Set up Homebrew
      id: set-up-homebrew
      run: |
        if which brew &>/dev/null; then
          HOMEBREW_PREFIX="$(brew --prefix)"
          HOMEBREW_REPOSITORY="$HOMEBREW_PREFIX/Homebrew"
        else
          HOMEBREW_PREFIX=/home/linuxbrew/.linuxbrew
          HOMEBREW_REPOSITORY="$HOMEBREW_PREFIX/Homebrew"
          sudo mkdir -p "$HOMEBREW_REPOSITORY/Library/Taps"
          git -C "$HOMEBREW_REPOSITORY" init
          git -C "$HOMEBREW_REPOSITORY" remote add origin "https://github.com/$GITHUB_REPOSITORY"

          cd "$HOMEBREW_PREFIX"
          sudo mkdir -p bin etc include lib opt sbin share var/homebrew/linked Cellar
          sudo ln -sf ../Homebrew/bin/brew "$HOMEBREW_PREFIX/bin/"
          cd -
        fi

        export PATH="$HOMEBREW_PREFIX/bin:$PATH"
        echo "::add-path::$HOMEBREW_PREFIX/bin"

        cd "$HOMEBREW_REPOSITORY"
        rm -rf "$GITHUB_WORKSPACE"
        ln -s "$HOMEBREW_REPOSITORY" "$GITHUB_WORKSPACE"
        git fetch --tags origin "${{github.sha}}"
        git checkout --force -B master FETCH_HEAD
        brew update-reset Library/Taps/homebrew/homebrew-core
        cd -

        GEMS_HASH=$(shasum -a 256 "$HOMEBREW_REPOSITORY/Library/Homebrew/Gemfile.lock" | cut -f1 -d' ')
        echo "::set-output name=gems-hash::$GEMS_HASH"

        if [ "$RUNNER_OS" = "Linux" ]; then
          sudo chown -R "$USER" "$HOMEBREW_PREFIX"
        fi

    - name: Set up Ruby
      if: matrix.os == 'ubuntu-latest'
      uses: actions/setup-ruby@master
      with:
        ruby-version: '2.6'

    - name: Run brew config
      run: brew config

    - name: Run brew doctor
      run: |
        if [ "$RUNNER_OS" = "Linux" ]; then
          # Cleanup some Linux `brew doctor` failures
          sudo rm -rf /usr/local/include/node/
        else
          # Allow Xcode to be outdated
          export HOMEBREW_GITHUB_ACTIONS=1

          # Link old gettext (otherwise `brew doctor` is sad)
          brew link gettext
          brew uninstall --force python@2
        fi
        brew doctor

    - name: Cache Bundler RubyGems
      id: cache
      uses: actions/cache@v1
      with:
        path: Library/Homebrew/vendor/bundle/ruby/
        key: ${{ runner.os }}-rubygems-${{ steps.set-up-homebrew.outputs.gems-hash }}
        restore-keys: |
          ${{ runner.os }}-rubygems-

    - name: Install Bundler RubyGems
      if: steps.cache.outputs.cache-hit != 'true'
      run: brew install-bundler-gems

    - name: Check for uncommitted RubyGems
      run: git diff --stat --exit-code Library/Homebrew/vendor/bundle/ruby

    - name: Install taps
      run: |
        # Install taps needed for 'brew tests' and 'brew man'
        export HOMEBREW_NO_AUTO_UPDATE=1
        cd "$(brew --repo)"
        brew tap homebrew/bundle
        brew update-reset Library/Taps/homebrew/homebrew-bundle
        brew tap homebrew/services
        brew update-reset Library/Taps/homebrew/homebrew-services<commit_msg>add a comment<commit_after>name: GitHub Actions CI
on:
  push:
    branches: master
  pull_request: []
  release:
    types:
      - published
jobs:
  tests:
    if: github.repository == 'Homebrew/brew'
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest, macOS-latest]
    steps:
    - name: Set up Homebrew
      id: set-up-homebrew
      run: |
        if which brew &>/dev/null; then
          HOMEBREW_PREFIX="$(brew --prefix)"
          HOMEBREW_REPOSITORY="$HOMEBREW_PREFIX/Homebrew"
        else
          HOMEBREW_PREFIX=/home/linuxbrew/.linuxbrew
          HOMEBREW_REPOSITORY="$HOMEBREW_PREFIX/Homebrew"
          sudo mkdir -p "$HOMEBREW_REPOSITORY/Library/Taps"
          git -C "$HOMEBREW_REPOSITORY" init
          git -C "$HOMEBREW_REPOSITORY" remote add origin "https://github.com/$GITHUB_REPOSITORY"

          cd "$HOMEBREW_PREFIX"
          sudo mkdir -p bin etc include lib opt sbin share var/homebrew/linked Cellar
          sudo ln -sf ../Homebrew/bin/brew "$HOMEBREW_PREFIX/bin/"
          cd -
        fi

        export PATH="$HOMEBREW_PREFIX/bin:$PATH"
        echo "::add-path::$HOMEBREW_PREFIX/bin"

        cd "$HOMEBREW_REPOSITORY"
        rm -rf "$GITHUB_WORKSPACE"
        ln -s "$HOMEBREW_REPOSITORY" "$GITHUB_WORKSPACE"
        git fetch --tags origin "${{github.sha}}"
        git checkout --force -B master FETCH_HEAD
        brew update-reset Library/Taps/homebrew/homebrew-core
        cd -

        GEMS_HASH=$(shasum -a 256 "$HOMEBREW_REPOSITORY/Library/Homebrew/Gemfile.lock" | cut -f1 -d' ')
        echo "::set-output name=gems-hash::$GEMS_HASH"

        if [ "$RUNNER_OS" = "Linux" ]; then
          sudo chown -R "$USER" "$HOMEBREW_PREFIX"
        fi

    - name: Set up Ruby
      if: matrix.os == 'ubuntu-latest'
      uses: actions/setup-ruby@master
      with:
        ruby-version: '2.6'

    - name: Run brew config
      run: brew config

    - name: Run brew doctor
      run: |
        if [ "$RUNNER_OS" = "Linux" ]; then
          # Cleanup some Linux `brew doctor` failures
          sudo rm -rf /usr/local/include/node/
        else
          # Allow Xcode to be outdated
          export HOMEBREW_GITHUB_ACTIONS=1

          # Link old gettext (otherwise `brew doctor` is sad)
          brew link gettext

          # remove deleted formula
          brew uninstall --force python@2
        fi
        brew doctor

    - name: Cache Bundler RubyGems
      id: cache
      uses: actions/cache@v1
      with:
        path: Library/Homebrew/vendor/bundle/ruby/
        key: ${{ runner.os }}-rubygems-${{ steps.set-up-homebrew.outputs.gems-hash }}
        restore-keys: |
          ${{ runner.os }}-rubygems-

    - name: Install Bundler RubyGems
      if: steps.cache.outputs.cache-hit != 'true'
      run: brew install-bundler-gems

    - name: Check for uncommitted RubyGems
      run: git diff --stat --exit-code Library/Homebrew/vendor/bundle/ruby

    - name: Install taps
      run: |
        # Install taps needed for 'brew tests' and 'brew man'
        export HOMEBREW_NO_AUTO_UPDATE=1
        cd "$(brew --repo)"
        brew tap homebrew/bundle
        brew update-reset Library/Taps/homebrew/homebrew-bundle
        brew tap homebrew/services
        brew update-reset Library/Taps/homebrew/homebrew-services
{'fraction_non_alphanumeric': 0.10927051671732523, 'fraction_numerical': 0.00303951367781155, 'mean_word_length': 2.075233644859813, 'pattern_counts': {'":': 4, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '1850212', 'n_tokens_mistral': 2226, 'n_tokens_neox': 2082, 'n_words': 524}