...
1# This action requires that any PR targeting the main branch should touch at
2# least one CHANGELOG file. If a CHANGELOG entry is not required, or if
3# performing maintenance on the Changelog, add either \"[chore]\" to the title of
4# the pull request or add the \"Skip Changelog\" label to disable this action.
5
6name: changelog
7
8on:
9 pull_request:
10 types: [opened, synchronize, reopened, labeled, unlabeled]
11 branches:
12 - main
13jobs:
14 changelog:
15 runs-on: ubuntu-latest
16 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]')}}
17
18 steps:
19 - uses: actions/checkout@v4
20
21 - name: Check for CHANGELOG changes
22 run: |
23 # Only the latest commit of the feature branch is available
24 # automatically. To diff with the base branch, we need to
25 # fetch that too (and we only need its latest commit).
26 git fetch origin ${{ github.base_ref }} --depth=1
27 if [[ $(git diff --name-only FETCH_HEAD | grep CHANGELOG) ]]
28 then
29 echo "A CHANGELOG was modified. Looks good!"
30 else
31 echo "No CHANGELOG was modified."
32 echo "Please add a CHANGELOG entry, or add the \"Skip Changelog\" label if not required."
33 false
34 fi
View as plain text