name: Update pinned dependencies

on:
  schedule:
    - cron: 0 0 * * 0
  workflow_dispatch:

permissions:
  contents: read

jobs:
  release:
    name: Update pinned dependencies
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
        with:
          persist-credentials: false
      - name: Set up Python 3.14
        uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
        with:
          python-version: '3.14'
      - name: Update pinned dependencies
        env:
          # used by update_gha_pins to avoid github api rate limits
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        run: ./build.sh upgrade-requirements
      - name: Open pull request
        uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
        with:
          token: ${{secrets.GH_TOKEN}}
          delete-branch: true
          title: Update pinned dependencies
          body: |
            Automatically update pinned dependencies
          commit-message: 'Update pinned dependencies'
          committer: 'CI on behalf of the Hypothesis team <zac@zhd.dev>'
          author: 'CI on behalf of the Hypothesis team <zac@zhd.dev>'
