Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/check-changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Check changelog

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

concurrency:
group: check-changelog-${{ github.event.pull_request.number }}
cancel-in-progress: true

permissions:
contents: read
pull-requests: read

Comment thread
emilykl marked this conversation as resolved.
jobs:
check-changelog:
name: Check if CHANGELOG.md was updated
if: ${{ !github.event.pull_request.draft }}
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ github.token }}
HAS_SKIP_LABEL: ${{ contains(github.event.pull_request.labels.*.name, 'no-changelog') }}
steps:
- run: |
if [ "$HAS_SKIP_LABEL" = true ]; then
echo "::notice::This PR has the 'no-changelog' label, so a change to CHANGELOG.md is not required."
elif gh api "repos/${{ github.repository }}/pulls/${{ github.event.number }}/files" --paginate --jq '.[].filename' | grep -qx CHANGELOG.md; then
echo "::notice::CHANGELOG.md was updated."
else
echo "::error::CHANGELOG.md was not updated. Either add a changelog entry, or add the 'no-changelog' label to this PR if a changelog entry is not needed."
exit 1
fi
3 changes: 2 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,8 @@ When creating your pull request, please follow the guidelines below.
- If your PR modifies code of `plotly.graph_objects`, the modifications should be made to the code generator, *not* the generated files.
- You have added tests or modified existing tests, as needed.
- For a new feature, you have added documentation examples (please see the doc checklist as well).
- You have added a CHANGELOG entry if changing anything substantial.
- You have added a changelog entry to `CHANGELOG.md` if changing anything substantial.
- The CI job "Check changelog" will fail if the PR does not update `CHANGELOG.md`. To bypass this check for PRs which don't require a changelog entry (e.g. docs updates), add the `no-changelog` label to the PR.
- For a new feature or a change in behavior, you have updated the relevant docstrings in the code.

### Documentation pull request
Expand Down
Loading