-
Notifications
You must be signed in to change notification settings - Fork 940
ci: add changelog verification workflow #4776
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
1e4f8a7
bd3bf16
2c833d1
6282c6f
160356b
55dd434
a4bf257
420f057
e36ae80
335ee65
c5877f4
de25f9d
058981a
847861a
4bc8bc3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,47 @@ | ||||||||||||||||
| # This action requires that any PR targeting the main branch should touch at | ||||||||||||||||
| # least one CHANGELOG file. If a CHANGELOG entry is not required, add the | ||||||||||||||||
| # "Skip Changelog" label, the "dependencies" label, or include "[chore]" in | ||||||||||||||||
| # the PR title. | ||||||||||||||||
|
|
||||||||||||||||
| name: Verify CHANGELOG | ||||||||||||||||
|
|
||||||||||||||||
| on: | ||||||||||||||||
| pull_request: | ||||||||||||||||
| types: [opened, synchronize, reopened, labeled, unlabeled] | ||||||||||||||||
| branches: | ||||||||||||||||
| - main | ||||||||||||||||
|
|
||||||||||||||||
| permissions: read-all | ||||||||||||||||
|
|
||||||||||||||||
| jobs: | ||||||||||||||||
| changelog: | ||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||
|
|
||||||||||||||||
| # Skip if: | ||||||||||||||||
| # - PR has "Skip Changelog" label | ||||||||||||||||
| # - PR has "dependencies" label | ||||||||||||||||
| # - PR title contains "[chore]" | ||||||||||||||||
| if: > | ||||||||||||||||
| ! contains(github.event.pull_request.labels.*.name, 'Skip Changelog') && | ||||||||||||||||
| ! contains(github.event.pull_request.labels.*.name, 'dependencies') && | ||||||||||||||||
| ! contains(github.event.pull_request.title, '[chore]') | ||||||||||||||||
|
|
||||||||||||||||
| steps: | ||||||||||||||||
| - name: Checkout repository | ||||||||||||||||
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | ||||||||||||||||
| with: | ||||||||||||||||
| fetch-depth: 0 | ||||||||||||||||
|
|
||||||||||||||||
| - name: Verify CHANGELOG updated | ||||||||||||||||
| run: | | ||||||||||||||||
| echo "Fetching base branch..." | ||||||||||||||||
| git fetch origin ${{ github.base_ref }} --depth=1 | ||||||||||||||||
|
|
||||||||||||||||
| echo "Checking for CHANGELOG modifications..." | ||||||||||||||||
| if git diff --name-only FETCH_HEAD | grep -q 'CHANGELOG'; then | ||||||||||||||||
|
Comment on lines
+37
to
+41
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this fixes a subtle bug in the workflow, which is that once a new commit is merged to (also I inlined
Suggested change
|
||||||||||||||||
| echo "CHANGELOG updated — OK" | ||||||||||||||||
| else | ||||||||||||||||
| echo "::error::No CHANGELOG file was updated in this PR." | ||||||||||||||||
| echo "Please update CHANGELOG or use the 'Skip Changelog' label if appropriate." | ||||||||||||||||
| false | ||||||||||||||||
| fi | ||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.