name: Release drafter

on:
  push:
    # branches to consider in the event; optional, defaults to all
    branches:
      - main
  workflow_dispatch:

permissions:
  contents: read

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

env:
  FORCE_COLOR: 1

jobs:
  update_release_draft:
    permissions:
      contents: write  # for release-drafter/release-drafter to create a github release
      pull-requests: write  # for release-drafter/release-drafter to add label to PR
    if: github.repository == 'python-pillow/Pillow'
    runs-on: ubuntu-slim
    steps:
      # Drafts your next release notes as pull requests are merged into "main"
      - uses: release-drafter/release-drafter@eada3c96a64734dd381cfbda23511034e328ddb0 # v7.6.0
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
