name: Update generated headers
on:
  push:
    branches:
      - '**'
jobs:
  filelists:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v4
    - name: Setup
      run: |
        sudo rm /etc/apt/sources.list.d/microsoft-prod.list
        sudo apt update
        sudo apt install -y libboost-dev
    - name: Configure
      run: |
        ./autogen.sh
        ./configure
    - name: Update headers
      run: |
        find ql -name *.am | xargs touch
        make dist
        rm QuantLib-*.tar.gz
    - uses: peter-evans/create-pull-request@v7
      with:
        token: ${{ secrets.GITHUB_TOKEN }}
        branch: update-generated-headers-${{ github.ref_name }}
        delete-branch: true
        commit-message: 'Update generated headers'
        title: 'Update generated headers'
        author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
