name: Convert CHANGELOG to Fastlane
on:
  push:
    branches:
      - master

jobs:
  convert_changelog_to_fastlane:
    runs-on: ubuntu-latest
    name: Convert CHANGELOG to Fastlane
    steps:
    - name: Checkout repo
      id: checkout
      uses: actions/checkout@v2
    - name: Setup Python
      uses: actions/setup-python@v2
      with:
        python-version: '3.x'
    - name: Run converter script
      run: python .scripts/changelog_to_fastlane.py
    - name: Create Pull Request
      uses: peter-evans/create-pull-request@v3
      with:
        title: "Update Fastlane changelogs"
        commit-message: "Update Fastlane changelogs"
        branch-suffix: timestamp
