diff --git a/.github/workflows/update-changelog.yml b/.github/workflows/update-changelog.yml index b13e32cf..653893b3 100644 --- a/.github/workflows/update-changelog.yml +++ b/.github/workflows/update-changelog.yml @@ -1,25 +1,39 @@ name: Update Changelog on: - pull_request: - types: [opened, edited] + issue_comment: + types: [created] 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]' + # Only run if this is a comment on a PR containing "@actions-user changelog" + # and not a comment made by GitHub Action to avoid infinite loops + if: github.event.issue.pull_request && contains(github.event.comment.body, '@actions-user changelog') && github.actor != 'github-actions[bot]' runs-on: ubuntu-latest permissions: contents: write pull-requests: write steps: + - name: Get PR details + id: pr-details + uses: actions/github-script@v7 + with: + script: | + const { data: pullRequest } = await github.rest.pulls.get({ + owner: context.repo.owner, + repo: context.repo.repo, + pull_number: context.issue.number + }); + core.setOutput('number', pullRequest.number); + core.setOutput('title', pullRequest.title); + core.setOutput('head_ref', pullRequest.head.ref); + - name: Checkout repository uses: actions/checkout@v4 with: # Checkout the PR head ref - ref: ${{ github.event.pull_request.head.ref }} + ref: ${{ steps.pr-details.outputs.head_ref }} token: ${{ secrets.GITHUB_TOKEN }} - name: Set up Python @@ -30,8 +44,8 @@ jobs: - name: Update changelog run: | python modify_changelog.py update_changelog \ - "${{ github.event.pull_request.number }}" \ - "${{ github.event.pull_request.title }}" + "${{ steps.pr-details.outputs.number }}" \ + '${{ steps.pr-details.outputs.title }}' - name: Check for changes id: changes @@ -48,5 +62,5 @@ jobs: 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 commit -m "Add changelog entry for PR #${{ steps.pr-details.outputs.number }}" git push \ No newline at end of file diff --git a/docs/changelog.md b/docs/changelog.md index ff6df709..9b31876c 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -4,13 +4,11 @@ _This project uses semantic versioning_ ## UNRELEASED -## 11.0.0 (2025-08-08) - - Change conversion between binary operators to consider converting both types [#320](https://github.com/egraphs-good/egglog-python/pull/320) - Add ability to parse egglog expressions into Python values [#319](https://github.com/egraphs-good/egglog-python/pull/319) - Deprecates `.eval()` method on primitives in favor of `.value` which can be used with pattern matching. - Support methods like on expressions [#315](https://github.com/egraphs-good/egglog-python/pull/315) -- Automatically Create Changelog Entry for PRs [#313](https://github.com/egraphs-good/egglog-python/pull/313) +- 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) - Upgrade egglog which includes new backend. - Fixes implementation of the Python Object sort to work with objects with dupliating hashes but the same value. Also changes the representation to be an index into a list instead of the ID, making egglog programs more deterministic.