Skip to content

Commit 17af2f7

Browse files
Merge pull request #317 from egraphs-good/copilot/fix-316
Fix automatic changelog generation for PR titles with markdown backticks and make workflow comment-triggered
2 parents f5a0db9 + 08392aa commit 17af2f7

File tree

2 files changed

+24
-12
lines changed

2 files changed

+24
-12
lines changed

.github/workflows/update-changelog.yml

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,39 @@
11
name: Update Changelog
22

33
on:
4-
pull_request:
5-
types: [opened, edited]
4+
issue_comment:
5+
types: [created]
66

77
jobs:
88
update-changelog:
9-
# Only run if this is not a PR from a fork to avoid permission issues
10-
# and not a commit made by GitHub Action to avoid infinite loops
11-
if: github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'github-actions[bot]'
9+
# Only run if this is a comment on a PR containing "@actions-user changelog"
10+
# and not a comment made by GitHub Action to avoid infinite loops
11+
if: github.event.issue.pull_request && contains(github.event.comment.body, '@actions-user changelog') && github.actor != 'github-actions[bot]'
1212
runs-on: ubuntu-latest
1313
permissions:
1414
contents: write
1515
pull-requests: write
1616

1717
steps:
18+
- name: Get PR details
19+
id: pr-details
20+
uses: actions/github-script@v7
21+
with:
22+
script: |
23+
const { data: pullRequest } = await github.rest.pulls.get({
24+
owner: context.repo.owner,
25+
repo: context.repo.repo,
26+
pull_number: context.issue.number
27+
});
28+
core.setOutput('number', pullRequest.number);
29+
core.setOutput('title', pullRequest.title);
30+
core.setOutput('head_ref', pullRequest.head.ref);
31+
1832
- name: Checkout repository
1933
uses: actions/checkout@v4
2034
with:
2135
# Checkout the PR head ref
22-
ref: ${{ github.event.pull_request.head.ref }}
36+
ref: ${{ steps.pr-details.outputs.head_ref }}
2337
token: ${{ secrets.GITHUB_TOKEN }}
2438

2539
- name: Set up Python
@@ -30,8 +44,8 @@ jobs:
3044
- name: Update changelog
3145
run: |
3246
python modify_changelog.py update_changelog \
33-
"${{ github.event.pull_request.number }}" \
34-
"${{ github.event.pull_request.title }}"
47+
"${{ steps.pr-details.outputs.number }}" \
48+
'${{ steps.pr-details.outputs.title }}'
3549
3650
- name: Check for changes
3751
id: changes
@@ -48,5 +62,5 @@ jobs:
4862
git config --local user.email "[email protected]"
4963
git config --local user.name "GitHub Action"
5064
git add docs/changelog.md
51-
git commit -m "Add changelog entry for PR #${{ github.event.pull_request.number }}"
65+
git commit -m "Add changelog entry for PR #${{ steps.pr-details.outputs.number }}"
5266
git push

docs/changelog.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,11 @@ _This project uses semantic versioning_
44

55
## UNRELEASED
66

7-
## 11.0.0 (2025-08-08)
8-
97
- Change conversion between binary operators to consider converting both types [#320](https://github.com/egraphs-good/egglog-python/pull/320)
108
- Add ability to parse egglog expressions into Python values [#319](https://github.com/egraphs-good/egglog-python/pull/319)
119
- Deprecates `.eval()` method on primitives in favor of `.value` which can be used with pattern matching.
1210
- Support methods like on expressions [#315](https://github.com/egraphs-good/egglog-python/pull/315)
13-
- Automatically Create Changelog Entry for PRs [#313](https://github.com/egraphs-good/egglog-python/pull/313)
11+
- Automatically Create Changelog Entry for PRs [#313](https://github.com/egraphs-good/egglog-python/pull/313) [#317](https://github.com/egraphs-good/egglog-python/pull/317)
1412
- Upgrade egglog which includes new backend.
1513
- Fixes implementation of the Python Object sort to work with objects with dupliating hashes but the same value.
1614
Also changes the representation to be an index into a list instead of the ID, making egglog programs more deterministic.

0 commit comments

Comments
 (0)