-
Notifications
You must be signed in to change notification settings - Fork 14
Automatically Create Changelog Entry for PRs #313
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 6 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
d321e3e
Initial plan
Copilot 6365379
Implement automatic changelog generation for PRs
Copilot 6dca75e
Add documentation and tests for changelog automation
Copilot a1a0255
Add changelog entry for PR #313
actions-user d874184
Integrate changelog PR automation into increment_version.py script
Copilot 7d0f459
Move changelog automation docs to contributing guide and make concise
Copilot 30a865b
Refactor increment_version.py to modify_changelog.py with subcommands…
Copilot 996332b
Combine version bump tests using pytest.param and add changelog entry…
Copilot e127729
Add changelog entry for PR #313
actions-user 9605a91
Update docs/changelog.md
saulshanabrook 55c4fe9
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 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,53 @@ | ||
name: Update Changelog | ||
|
||
on: | ||
pull_request: | ||
types: [opened, edited] | ||
|
||
jobs: | ||
update-changelog: | ||
# Only run if this is not a PR from a fork to avoid permission issues | ||
# and not a commit made by GitHub Action to avoid infinite loops | ||
if: github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'github-actions[bot]' | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
# Checkout the PR head ref | ||
ref: ${{ github.event.pull_request.head.ref }} | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.12' | ||
|
||
- name: Update changelog | ||
run: | | ||
python increment_version.py --add-pr \ | ||
--pr-number="${{ github.event.pull_request.number }}" \ | ||
--pr-title="${{ github.event.pull_request.title }}" \ | ||
--pr-url="${{ github.event.pull_request.html_url }}" | ||
|
||
- name: Check for changes | ||
id: changes | ||
run: | | ||
if git diff --quiet docs/changelog.md; then | ||
echo "changed=false" >> $GITHUB_OUTPUT | ||
else | ||
echo "changed=true" >> $GITHUB_OUTPUT | ||
fi | ||
|
||
- name: Commit and push changes | ||
if: steps.changes.outputs.changed == 'true' | ||
run: | | ||
git config --local user.email "action@github.com" | ||
git config --local user.name "GitHub Action" | ||
git add docs/changelog.md | ||
git commit -m "Add changelog entry for PR #${{ github.event.pull_request.number }}" | ||
git push |
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
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.
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.