Skip to content

Commit

Permalink
Add GitHub action to validate staged changelogs
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
JordonPhillips committed Nov 20, 2024
1 parent 2006c42 commit d7debee
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/changelog-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: changelog
on: pull_request_target
permissions: write-all
jobs:
amend:
name: "Validate staged changelogs"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}

- uses: actions/setup-python@v5
with:
python-version: "3.13"

- name: "Run validation script"
env:
GITHUB_TOKEN: ${{ github.token }}
TARGET_SHA: ${{ github.event.pull_request.head.sha }}
PR_TITLE: ${{ github.event.pull_request.title }}
run: |
git fetch origin ${{ github.base_ref }}
./.changes/amend --review-comment -n ${{ github.event.pull_request.number }}

0 comments on commit d7debee

Please sign in to comment.