-
-
Notifications
You must be signed in to change notification settings - Fork 395
ci: add changeset release alignment check #2204
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
Open
Adi-204
wants to merge
5
commits into
asyncapi:master
Choose a base branch
from
Adi-204:ci/changeset-release-pr-guard
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
3a1e5a4
ci: add PR check for changeset and release title alignment
Adi-204 504772f
ci: shorten changeset alignment error messages
Adi-204 d49317c
ci: inherit GITHUB_TOKEN defaults and link release docs in errors
Adi-204 60f4303
chore: revert Development.md; add temporary test changeset for CI
Adi-204 c688183
ci: simplify changeset title error message; remove test changeset
Adi-204 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| # v1: changeset .md in the PR diff and release-style PR title must both be present or both absent. | ||
| name: Verify changeset release alignment | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [opened, reopened, synchronize, edited, ready_for_review] | ||
|
|
||
| jobs: | ||
| verify-changeset-release-alignment: | ||
| name: Verify changeset release alignment | ||
| runs-on: ubuntu-latest | ||
| if: > | ||
| !github.event.pull_request.draft && | ||
| github.event.pull_request.user.login != 'asyncapi-bot' && | ||
| github.event.pull_request.user.login != 'dependabot[bot]' && | ||
| github.event.pull_request.user.login != 'dependabot-preview[bot]' | ||
| env: | ||
| # Human squash-merge titles that trigger Release (see release-with-changesets.yml; chore(release): is bot-only and skipped above). | ||
| TITLE_TRIGGERS_RELEASE: ${{ startsWith(github.event.pull_request.title, 'fix:') || startsWith(github.event.pull_request.title, 'fix!:') || startsWith(github.event.pull_request.title, 'feat:') || startsWith(github.event.pull_request.title, 'feat!:') }} | ||
| steps: | ||
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
|
|
||
| - uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1 | ||
| id: filter | ||
| with: | ||
| filters: | | ||
| changeset_md: | ||
| - '.changeset/**.md' | ||
|
|
||
| - name: Changeset in PR but title will not trigger Release | ||
| if: steps.filter.outputs.changeset_md == 'true' && env.TITLE_TRIGGERS_RELEASE != 'true' | ||
| run: | | ||
| echo "::error title=Changeset / release title mismatch::This PR changes .changeset/*.md but the squash-merge title will not trigger Release. Use fix:, fix!:, feat:, or feat!: at the start of the title. More info: https://github.com/asyncapi/generator/blob/master/Development.md#release-process" | ||
| exit 1 | ||
|
|
||
| - name: Release title but no changeset in PR | ||
| if: steps.filter.outputs.changeset_md != 'true' && env.TITLE_TRIGGERS_RELEASE == 'true' | ||
| run: | | ||
| echo "::error title=Changeset / release title mismatch::Release-style PR title but no .changeset/*.md in this PR. Add a changeset or use a non-release title (docs:, chore:, …). More info: https://github.com/asyncapi/generator/blob/master/Development.md#release-process" | ||
| exit 1 | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.