Skip to content

Commit 50fa20e

Browse files
Add GitHub action to validate staged changelogs
This adds a GitHub action that checks for staged changelogs. If they aren't present, it posts a reminder comment to add them. It does *not* fail the build because there are valid cases where a changelog is not desired. If there are changelog entries present, it ensures that they have a pull request associated with them. If they don't, it posts a pr comment with a change suggestion that adds it in. It still does not fail the build because maybe there's a reason not to add it.
1 parent 6e66404 commit 50fa20e

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

.github/workflows/changelog-ci.yml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: changelog
2+
on: pull_request_target
3+
permissions: write-all
4+
jobs:
5+
amend:
6+
name: "Validate staged changelogs"
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v4
10+
with:
11+
ref: ${{ github.head_ref }}
12+
repository: ${{ github.event.pull_request.head.repo.full_name }}
13+
14+
- uses: actions/setup-python@v5
15+
with:
16+
python-version: "3.13"
17+
18+
- name: "Run validation script"
19+
env:
20+
GITHUB_TOKEN: ${{ github.token }}
21+
TARGET_SHA: ${{ github.event.pull_request.head.sha }}
22+
PR_TITLE: ${{ github.event.pull_request.title }}
23+
run: |
24+
git fetch origin ${{ github.base_ref }}
25+
./.changes/amend --review-comment -n ${{ github.event.pull_request.number }}

0 commit comments

Comments
 (0)