-
Notifications
You must be signed in to change notification settings - Fork 150
49 lines (41 loc) · 1.88 KB
/
validate-changelog.yaml
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: Ensure valid and up-to-date Changelog
# Description: Automates the validation of .chloggen (CHANGELOG.md) entries ensuring:
# 1. All entries are valid.
# 2. A new entry is added for updates to chart templates or rendered example content.
# 3. Bypass validation with a 'Skip Changelog' label or a PR title containing '[chore]'.
on: pull_request
jobs:
validate-changelog:
if: ${{ !contains(github.event.pull_request.labels.*.name, 'Skip Changelog') && !contains(github.event.pull_request.title, '[chore]') }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
- name: Install chloggen
run: make install-tools
- name: Run make chlog-validate
run: |
if ! make chlog-validate; then
echo "Options:"
echo "- Add a Changelog Entry: Please add a '.yaml' file to the './.chloggen/' directory detailing the changes in your commit. See 'CONTRIBUTING.md' for guidance on creating this entry."
echo "- Skip the Changelog Check: If your changes don't necessitate a changelog entry or it's a minor chore, you can skip this check by:"
echo " 1. Adding '[chore]' to the title of the pull request"
echo " 2. Applying the 'Skip Changelog' label to the pull request."
exit 1
fi
- name: Read current version of the Chart
id: read-chart
uses: cumulusds/get-yaml-paths-action@v1
with:
file: helm-charts/splunk-otel-collector/Chart.yaml
version: version
- name: Ensure that CHANGELOG.md has an entry for the current version
id: read-changelog
uses: mindsers/changelog-reader-action@v2
with:
version: ${{ steps.read-chart.outputs.version }}
path: ./CHANGELOG.md