name: Changelog

on:
  pull_request:
    types: [labeled, unlabeled, opened, synchronize, reopened]

permissions:
  contents: read

# Only cancel in-progress jobs or runs for the current workflow
#   This cancels the already triggered workflows for a specific PR without canceling
#   other instances of this workflow (other PRs, scheduled triggers, etc) when something
#   within that PR re-triggers this CI
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

jobs:
  changelog:
    name: Confirm changelog entry
    runs-on: ubuntu-latest
    steps:
    - name: Check change log entry
      uses: scientific-python/action-check-changelogfile@6087eddce1d684b0132be651a4dad97699513113  # 0.2
      env:
        CHANGELOG_FILENAME: CHANGES.rst
        CHECK_MILESTONE: false
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
