-
Notifications
You must be signed in to change notification settings - Fork 1.7k
add towncrier to manage changelogs #6350
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
adhami3310
wants to merge
3
commits into
main
Choose a base branch
from
add-towncrier-to-manage-changelogs
base: main
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
3 commits
Select commit
Hold shift + click to select a range
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,86 @@ | ||
| name: changelog | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.event.pull_request.id }} | ||
| cancel-in-progress: true | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: ["main"] | ||
|
|
||
| jobs: | ||
| changelog: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 10 | ||
| steps: | ||
| - name: Check for skip-changelog label | ||
| id: skip | ||
| shell: bash | ||
| env: | ||
| SKIP_CHANGELOG: ${{ contains(github.event.pull_request.labels.*.name, 'skip-changelog') }} | ||
| run: | | ||
| if [ "$SKIP_CHANGELOG" = "true" ]; then | ||
| echo "skip=true" >> "$GITHUB_OUTPUT" | ||
| echo "PR has 'skip-changelog' label; bypassing changelog check." | ||
| else | ||
| echo "skip=false" >> "$GITHUB_OUTPUT" | ||
| fi | ||
| - uses: actions/checkout@v4 | ||
| if: steps.skip.outputs.skip != 'true' | ||
| with: | ||
| fetch-depth: 0 | ||
| - uses: ./.github/actions/setup_build_env | ||
| if: steps.skip.outputs.skip != 'true' | ||
| with: | ||
| python-version: "3.14" | ||
| run-uv-sync: true | ||
| - name: Determine affected packages | ||
| if: steps.skip.outputs.skip != 'true' | ||
| id: affected | ||
| shell: bash | ||
| run: | | ||
| set -euo pipefail | ||
| changed=$(git diff --name-only origin/main...HEAD) | ||
| affected=() | ||
| if printf '%s\n' "$changed" | grep -qE '^reflex/'; then | ||
| affected+=(".") | ||
| fi | ||
| for pkg_dir in packages/*/; do | ||
| pkg=$(basename "$pkg_dir") | ||
| [[ "$pkg" == "integrations-docs" ]] && continue | ||
| if printf '%s\n' "$changed" | grep -qE "^packages/$pkg/src/"; then | ||
| affected+=("${pkg_dir%/}") | ||
| fi | ||
| done | ||
| printf '%s\n' "${affected[@]}" > affected.txt | ||
| echo "Affected packages:" | ||
| cat affected.txt | ||
| - name: Check for news fragments | ||
| if: steps.skip.outputs.skip != 'true' | ||
| shell: bash | ||
| run: | | ||
| set -euo pipefail | ||
| if [ ! -s affected.txt ]; then | ||
| echo "No packaged source changes in this PR; no changelog fragments required." | ||
| exit 0 | ||
| fi | ||
| failed=0 | ||
| while IFS= read -r pkg_dir; do | ||
| [ -z "$pkg_dir" ] && continue | ||
| echo "::group::towncrier check ($pkg_dir)" | ||
| if ! uv run towncrier check --config pyproject.toml --dir "$pkg_dir" --compare-with origin/main; then | ||
| failed=1 | ||
| fi | ||
| echo "::endgroup::" | ||
| done < affected.txt | ||
| if [ "$failed" -ne 0 ]; then | ||
| echo "" | ||
| echo "One or more affected packages is missing a news fragment under <package>/news/." | ||
| echo "Add a fragment named <pr-number>.<type>.md where <type> is one of:" | ||
| echo " breaking, deprecation, feature, bugfix, performance, docs, misc" | ||
| echo "Or apply the 'skip-changelog' label if the change is genuinely not user-facing." | ||
| exit 1 | ||
| fi | ||
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
Empty file.
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 @@ | ||
| Introduced towncrier-based changelog management. Each PR that changes package source now adds a fragment under the affected package's `news/` directory; fragments are assembled into `CHANGELOG.md` at release time. See CONTRIBUTING.md for the full workflow. |
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.