Skip to content

Commit 09f9c23

Browse files
vanshika622pellaredtrask
authored
ci: add changelog verification workflow (#4776)
Fixes #2315 ## Changes - Add the workflow to verify the changes in changelog.md Please provide a brief description of the changes here. For non-trivial changes, follow the [change proposal process](https://github.com/open-telemetry/opentelemetry-specification/blob/main/CONTRIBUTING.md#proposing-a-change). * [x] Related issues # * [ ] Related [OTEP(s)](https://github.com/open-telemetry/oteps) # * [ ] Links to the prototypes (when adding or changing features) * [x] [`CHANGELOG.md`](https://github.com/open-telemetry/opentelemetry-specification/blob/main/CHANGELOG.md) file updated for non-trivial changes * [ ] [Spec compliance matrix](https://github.com/open-telemetry/opentelemetry-specification/blob/main/spec-compliance-matrix/template.yaml) updated if necessary --------- Co-authored-by: Robert Pająk <pellared@hotmail.com> Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
1 parent bc5da4d commit 09f9c23

1 file changed

Lines changed: 44 additions & 0 deletions

File tree

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
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, add the
3+
# "Skip Changelog" label, the "dependencies" label, or include "[chore]" in
4+
# the PR title.
5+
6+
name: Verify CHANGELOG
7+
8+
on:
9+
pull_request:
10+
types: [opened, synchronize, reopened, labeled, unlabeled]
11+
branches:
12+
- main
13+
14+
permissions: read-all
15+
16+
jobs:
17+
changelog:
18+
runs-on: ubuntu-latest
19+
20+
# Skip if:
21+
# - PR has "Skip Changelog" label
22+
# - PR has "dependencies" label
23+
# - PR title contains "[chore]"
24+
if: >
25+
! contains(github.event.pull_request.labels.*.name, 'Skip Changelog') &&
26+
! contains(github.event.pull_request.labels.*.name, 'dependencies') &&
27+
! contains(github.event.pull_request.title, '[chore]')
28+
29+
steps:
30+
- name: Checkout repository
31+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
32+
with:
33+
fetch-depth: 0
34+
35+
- name: Verify CHANGELOG updated
36+
run: |
37+
echo "Checking for CHANGELOG modifications..."
38+
if git diff --name-only --merge-base origin/${{ github.base_ref }} | grep -q 'CHANGELOG'; then
39+
echo "CHANGELOG updated — OK"
40+
else
41+
echo "::error::No CHANGELOG file was updated in this PR."
42+
echo "Please update CHANGELOG or use the 'Skip Changelog' label if appropriate."
43+
false
44+
fi

0 commit comments

Comments
 (0)