forked from scikit-learn/scikit-learn
-
Notifications
You must be signed in to change notification settings - Fork 0
33 lines (31 loc) · 1.08 KB
/
check-changelog.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
name: Check Changelog
# This check makes sure that the changelog is properly updated
# when a PR introduces a change in a test file.
# To bypass this check, label the PR with "No Changelog Needed".
on:
pull_request:
types: [opened, synchronize, labeled, unlabeled]
jobs:
check:
name: A reviewer will let you know if it is required or can be bypassed
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: Check if tests have changed
id: tests_changed
run: |
set -xe
changed_files=$(git diff --name-only origin/main)
# Changelog should be updated only if tests have been modified
if [[ "$changed_files" =~ tests ]]
then
echo "check_changelog=true" >> $GITHUB_OUTPUT
fi
- name: Check changelog entry
if: steps.tests_changed.outputs.check_changelog == 'true'
uses: scientific-python/action-towncrier-changelog@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BOT_USERNAME: changelog-bot