name: Changelog Update

on:
  push:
    branches:
    - develop

permissions:
  contents: read

jobs:
  update-changelog:
    permissions:
      contents: write  # for Git to git push
    name: Update Changelog
    runs-on: ubuntu-latest
    env:
      PYTHON_VERSION: 3.7
    steps:
    - uses: actions/checkout@v3
      with:
        fetch-depth: 0
    - uses: actions/checkout@v3
      with:
        repository: Flexget/wiki
        path: wiki
        token: ${{ secrets.flexgetbot_pat }}
        ref: main
    - name: Setup Git User
      run: |
        git config --global user.email ${{ secrets.git_email }}
        git config --global user.name ${{ secrets.git_user }}
    - name: Set up Python ${{ env.PYTHON_VERSION }}
      uses: actions/setup-python@v2
      with:
        python-version: ${{ env.PYTHON_VERSION }}
    - name: Install dev dependencies
      run: |
        pip --cache-dir pip_cache install -r dev-requirements.txt
    - name: Update the Changelog
      run: |
        set -x
        python update-changelog.py wiki/ChangeLog.md
        cd wiki
        git add ChangeLog.md
        if ! git diff --cached --exit-code; then
            git commit -m "Automated ChangeLog update"
            git push origin main
        fi

name: Changelog Update

on:
  push:
    branches:
    - develop

permissions:
  contents: read

jobs:
  update-changelog:
    permissions:
      contents: write  # for Git to git push
    name: Update Changelog
    runs-on: ubuntu-latest
    env:
      PYTHON_VERSION: 3.7
    steps:
    - uses: actions/checkout@v3
      with:
        fetch-depth: 0
    - uses: actions/checkout@v3
      with:
        repository: Flexget/wiki
        path: wiki
        token: ${{ secrets.flexgetbot_pat }}
        ref: main
    - name: Setup Git User
      run: |
        git config --global user.email ${{ secrets.git_email }}
        git config --global user.name ${{ secrets.git_user }}
    - name: Set up Python ${{ env.PYTHON_VERSION }}
      uses: actions/setup-python@v4
      with:
        python-version: ${{ env.PYTHON_VERSION }}
    - name: Install dev dependencies
      run: |
        pip --cache-dir pip_cache install -r dev-requirements.txt
    - name: Update the Changelog
      run: |
        set -x
        python update-changelog.py wiki/ChangeLog.md
        cd wiki
        git add ChangeLog.md
        if ! git diff --cached --exit-code; then
            git commit -m "Automated ChangeLog update"
            git push origin main
        fi

Update actions/setup-python action to v4
Update actions/setup-python action to v4