name: News entry check
on:
  pull_request:
    paths:
      - "src/memray/**"
    types:
      - "opened"
      - "reopened"
      - "synchronize"
      - "labeled"
      - "unlabeled"

jobs:
  news_entry_check:
    runs-on: ubuntu-latest
    name: Check for news entry
    steps:
      - name: "Check for news entry"
        uses: brettcannon/check-for-changed-files@v1
        with:
          file-pattern: |
            news/*.rst
            NEWS.rst
          skip-label: "skip news"
          failure-message: "Missing a news file in ${file-pattern}; please add one or apply the ${skip-label} label to the pull request"
