verctl 0.4.1

Stack-agnostic version PRs from Changesets-format fragments
name: Version PR

on:
  push:
    branches: [main]

permissions:
  contents: write
  pull-requests: write
  issues: write

env:
  GIT_CONFIG_COUNT: "1"
  GIT_CONFIG_KEY_0: init.defaultBranch
  GIT_CONFIG_VALUE_0: main
  MISE_ENV: ci

concurrency:
  group: version-pr-${{ github.ref }}
  cancel-in-progress: true

jobs:
  prepare:
    runs-on: ubuntu-latest
    steps:
      - name: Check out repository
        uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
        with:
          persist-credentials: false
          fetch-depth: 0
          fetch-tags: true
      - name: Set up mise
        uses: jdx/mise-action@c2a87611a18de5b3828c5652fe268e992400cb5c # v4.3.0
        with:
          version: 2026.10.3
          cache: true
      - run: mise install --locked
      - name: Mint Version PR token
        id: app-token
        uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
        with:
          client-id: ${{ secrets.CHANGESET_VERSION_APP_CLIENT_ID }}
          private-key: ${{ secrets.CHANGESET_VERSION_APP_PRIVATE_KEY }}
          repositories: ${{ github.event.repository.name }}
          permission-contents: write
          permission-pull-requests: write
      - name: Prepare release
        env:
          GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
        run: mise run ver prepare --pr
      - name: Enable auto-merge
        env:
          GH_TOKEN: ${{ steps.app-token.outputs.token }}
          REPO: ${{ github.repository }}
          BASE: ${{ github.event.repository.default_branch }}
        run: actions/version-pr/auto-merge.sh