name: Create weekly release
on:
  schedule:
    - cron: '30 3 * * 3'
  workflow_dispatch:

jobs:
  release:
    name: Release
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false

    steps:
      - uses: octokit/request-action@v2.x
        with:
          route: POST /repos/{owner}/{repo}/pulls
          owner: frappe
          repo: lms
          title: |-
            "chore: merge 'main-hotfix' into 'main'"
          body: "Automated weekly release"
          base: main
          head: main-hotfix
        env:
          GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}