-
Notifications
You must be signed in to change notification settings - Fork 74
Drive releases from CHANGELOG.md with towncrier (ENG-10965) #498
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
Merged
Merged
Changes from all commits
Commits
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
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,77 @@ | ||
| # Generated by reflex-release; do not edit by hand. | ||
| # Re-run `uvx reflex-release@0.1.0a3 sync` after changing [tool.reflex-release] in | ||
| # pyproject.toml. `uvx reflex-release@0.1.0a3 sync --check` fails when this file drifts. | ||
| name: changelog | ||
|
|
||
| # Two guards on every pull request: | ||
|
masenf marked this conversation as resolved.
|
||
| # | ||
| # 1. New CHANGELOG.md version headings are rejected. A merged version heading | ||
| # without a git tag is a real publish trigger (see | ||
| # release_from_changelog.yml), so headings must come from the Dispatch | ||
| # release workflow's release/* branches — not from hand edits. | ||
| # The guard uses the same parser the release pipeline publishes from, so the | ||
| # two cannot disagree. Escape hatch for deliberate restructuring of | ||
| # already-published sections: the 'changelog-version-edit' label. | ||
| # | ||
| # 2. Every package whose source the PR touches must add a news fragment under | ||
| # its news/ directory. Waive with the 'skip-changelog' label for changes | ||
| # that are genuinely not user-facing. | ||
| # | ||
| # 3. The generated release workflows must match what the pinned reflex-release | ||
| # version produces from [tool.reflex-release] — adding a package or editing | ||
| # the configuration without re-running `uvx reflex-release@0.1.0a3 sync` fails here rather than | ||
| # at release time. | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.event.pull_request.id }} | ||
| cancel-in-progress: true | ||
|
|
||
| # The branches are the ones release_from_changelog publishes from: a merged | ||
| # version heading is a publish trigger wherever it lands, and r/hotfix/** | ||
| # publishes final versions without going through main at all. | ||
| on: | ||
| pull_request: | ||
| branches: | ||
| ["main", "r/pre-**", "r/hotfix/**"] | ||
|
|
||
| jobs: | ||
| changelog: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 10 | ||
| steps: | ||
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| with: | ||
| fetch-depth: 0 | ||
| persist-credentials: false | ||
| - uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 | ||
| # The heading guard runs even for skip-changelog PRs: that label only | ||
| # waives the news-fragment requirement, not the publish-trigger guard. | ||
| # | ||
| # The exemption for release branches also requires the pull request to be | ||
| # authored by github-actions[bot], which is how the Dispatch release | ||
| # workflow opens it. A branch name is attacker-selectable; the author is | ||
| # not, so a contributor cannot skip the guard by naming their branch | ||
| # release/something and hand-writing a version heading. The | ||
| # 'changelog-version-edit' label needs triage rights to apply, so it is a | ||
| # sound escape hatch on its own. | ||
| - name: Reject manual changelog version headings | ||
| if: >- | ||
| ${{ !contains(github.event.pull_request.labels.*.name, 'changelog-version-edit') | ||
| && !(startsWith(github.head_ref, 'release/') | ||
| && github.event.pull_request.user.login == 'github-actions[bot]') }} | ||
| env: | ||
| BASE_REF: origin/${{ github.base_ref }} | ||
| shell: bash | ||
| run: uvx reflex-release@0.1.0a3 check-headings | ||
| - name: Check for news fragments | ||
| if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-changelog') }} | ||
| env: | ||
| BASE_REF: origin/${{ github.base_ref }} | ||
| shell: bash | ||
| run: uvx reflex-release@0.1.0a3 changelog-check | ||
| - name: Check the release workflows are up to date | ||
| shell: bash | ||
| run: uvx reflex-release@0.1.0a3 sync --check | ||
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
Oops, something went wrong.
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.