<commit_before>---
name: 'Automatic Database Updator'

on:
  schedule:
    - cron: '38 0 * * *'

jobs:
  update:
    name: 'Update database'

    runs-on: 'ubuntu-20.04'

    steps:
      - name: 'Check out the source'
        uses: 'actions/checkout@v2'
        with:
          fetch-depth: 0

      - name: 'Use PHP 8.0'
        run: |
          sudo update-alternatives --set php /usr/bin/php8.0
          php -v

      - name: 'Run Updator'
        run: |
          rm -f data/postalcode/jp/*.json.gz
          php php util/mkpostalcode.php

      - name: 'Check changed'
        run: |
          git add data/postalcode/jp
          git update-index -q --refresh
          if [ -z "$(git diff-index --name-only HEAD --)" ]; then
            echo "Nothing changed"
            echo "changed=0" >> $GITHUB_ENV
          else
            echo "Something changed"
            echo "changed=1" >> $GITHUB_ENV
          fi

      - name: 'Create Pull Request'
        if: '${{ env.changed == "1" }}'
        uses: 'peter-evans/create-pull-request@v3'
        with:
          assignees: 'fetus-hina'
          author: '<NAME> <<EMAIL>>'
          body: 'This is an automated pull-request'
          branch: 'autoupdate-database'
          commit-message: 'Update postal code database'
          committer: 'GitHub <<EMAIL>>'
          delete-branch: true
          draft: false
          labels: 'database'
          reviewers: 'fetus-hina'
          signoff: false<commit_msg>fix syntax error<commit_after>---
name: 'Automatic Database Updator'

on:
  schedule:
    - cron: '38 0 * * *'

jobs:
  update:
    name: 'Update database'

    runs-on: 'ubuntu-20.04'

    steps:
      - name: 'Check out the source'
        uses: 'actions/checkout@v2'
        with:
          fetch-depth: 0

      - name: 'Use PHP 8.0'
        run: |
          sudo update-alternatives --set php /usr/bin/php8.0
          php -v

      - name: 'Run Updator'
        run: |
          rm -f data/postalcode/jp/*.json.gz
          php php util/mkpostalcode.php

      - name: 'Check changed'
        run: |
          git add data/postalcode/jp
          git update-index -q --refresh
          if [ -z "$(git diff-index --name-only HEAD --)" ]; then
            echo "Nothing changed"
            echo "changed=0" >> $GITHUB_ENV
          else
            echo "Something changed"
            echo "changed=1" >> $GITHUB_ENV
          fi

      - name: 'Create Pull Request'
        if: "${{ env.changed == '1' }}"
        uses: 'peter-evans/create-pull-request@v3'
        with:
          assignees: 'fetus-hina'
          author: '<NAME> <<EMAIL>>'
          body: 'This is an automated pull-request'
          branch: 'autoupdate-database'
          commit-message: 'Update postal code database'
          committer: 'GitHub <<EMAIL>>'
          delete-branch: true
          draft: false
          labels: 'database'
          reviewers: 'fetus-hina'
          signoff: false
{'fraction_non_alphanumeric': 0.12461903149339655, 'fraction_numerical': 0.011513714866237725, 'mean_word_length': 1.5531547104580812, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 21, 'https://': 0, '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': '7291830', 'n_tokens_mistral': 980, 'n_tokens_neox': 920, 'n_words': 247}