2021-02-04 11:13:25 -08:00
|
|
|
# This action requires that any PR targeting the main branch should touch at
|
2023-02-17 16:45:41 -08:00
|
|
|
# least one CHANGELOG file. If a CHANGELOG entry is not required, or if
|
2023-04-11 17:28:13 -07:00
|
|
|
# performing maintenance on the Changelog, add either \"[chore]\" to the title of
|
2023-02-17 16:45:41 -08:00
|
|
|
# the pull request or add the \"Skip Changelog\" label to disable this action.
|
2020-09-08 20:50:05 -04:00
|
|
|
|
|
|
|
name: changelog
|
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
types: [opened, synchronize, reopened, labeled, unlabeled]
|
|
|
|
branches:
|
2021-01-29 11:37:52 -08:00
|
|
|
- main
|
2020-09-08 20:50:05 -04:00
|
|
|
jobs:
|
|
|
|
changelog:
|
|
|
|
runs-on: ubuntu-latest
|
2023-02-17 16:45:41 -08:00
|
|
|
if: ${{ !contains(github.event.pull_request.labels.*.name, 'dependencies') && !contains(github.event.pull_request.labels.*.name, 'Skip Changelog') && !contains(github.event.pull_request.title, '[chore]')}}
|
2020-09-08 20:50:05 -04:00
|
|
|
|
|
|
|
steps:
|
2022-03-04 10:15:56 -08:00
|
|
|
- uses: actions/checkout@v3
|
2020-09-08 20:50:05 -04:00
|
|
|
|
|
|
|
- name: Check for CHANGELOG changes
|
|
|
|
run: |
|
|
|
|
# Only the latest commit of the feature branch is available
|
|
|
|
# automatically. To diff with the base branch, we need to
|
|
|
|
# fetch that too (and we only need its latest commit).
|
|
|
|
git fetch origin ${{ github.base_ref }} --depth=1
|
|
|
|
if [[ $(git diff --name-only FETCH_HEAD | grep CHANGELOG) ]]
|
|
|
|
then
|
|
|
|
echo "A CHANGELOG was modified. Looks good!"
|
|
|
|
else
|
|
|
|
echo "No CHANGELOG was modified."
|
|
|
|
echo "Please add a CHANGELOG entry, or add the \"Skip Changelog\" label if not required."
|
|
|
|
false
|
|
|
|
fi
|