Skip to content

Commit

Permalink
chore: Adds PR check that verifies migration guide when flagged as br…
Browse files Browse the repository at this point in the history
…eaking change (#2141)

* create action

* check label

* check also title

* check only title

* check migration folder

* test add file

* use path filter

* simplify if condition

* Revert "test add file"

This reverts commit d0e82c7.

* change existing guide

* Revert "change existing guide"

This reverts commit d56a75c.

* message

* Revert "Revert "change existing guide""

This reverts commit 193ff9d.

* Revert "Revert "Revert "change existing guide"""

This reverts commit 60e26d1.

* doc

* update PR template
  • Loading branch information
lantoli authored Apr 15, 2024
1 parent 2c63f39 commit 7146a46
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ Link to any related issue(s):
## Type of change:

- [ ] Bug fix (non-breaking change which fixes an issue). Please, add the "bug" label to the PR.
- [ ] New feature (non-breaking change which adds functionality). Please, add the "enhancement" label to the PR.
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected). Please, add the "breaking change" label to the PR.
- [ ] New feature (non-breaking change which adds functionality). Please, add the "enhancement" label to the PR. A migration guide must be created or updated if the new feature will go in a major version.
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected). Please, add the "breaking change" label to the PR. A migration guide must be created or updated.
- [ ] This change requires a documentation update
- [ ] Documentation fix/enhancement

Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/check-migration-guide.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Check migration guide

on:
pull_request:
types: [opened, reopened, synchronize, edited]

jobs:
check:
if: ${{ contains(github.event.pull_request.title, '!') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36
id: changes
with:
filters: |
guides:
- 'website/docs/guides/**'
- if: ${{ steps.changes.outputs.guides == 'false' }}
run: echo "PR with breaking changes but no migration guide was created or updated" && exit 1
3 changes: 1 addition & 2 deletions contributing/development-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,9 @@ Use [*Conventional Commits*](https://www.conventionalcommits.org/) to name pull
- `style: Description of the PR`: The commit updates or reformats the style of the source code, but does not otherwise change the product implementation (this correlates with Minor in Semantic Versioning).
- `feat: Description of the PR`: a commit of the type feat introduces a new feature to the codebase (this correlates with MINOR in Semantic Versioning).
- `deprecate: Description of the PR`: The commit deprecates existing functionality, but does not remove it from the product (this correlates with MINOR in Semantic Versioning).
- `BREAKING CHANGE`: a commit that has a footer BREAKING CHANGE:, or appends a ! after the type/scope, introduces a breaking API change (correlating with MAJOR in Semantic Versioning). A BREAKING CHANGE can be part of commits of any type.
- `a ! in the description of the PR`: The commit introduces a breaking change (correlating with MAJOR in Semantic Versioning). A breaking change can be part of commits of any type.
Examples:
- `fix!: Description of the ticket`
- If the PR has `BREAKING CHANGE`: in its description is a breaking change
- `remove!: Description of the PR`: The commit removes a feature from the product. Typically features are deprecated first for a period of time before being removed. Removing a feature is a breaking change (correlating with MAJOR in Semantic Versioning).

Example PR title:
Expand Down

0 comments on commit 7146a46

Please sign in to comment.