This action checks for changes between branches (PR), based on Merge Pull Request commits and hotfixes, and returns formatted outputs (Markdown, HTML, JSON, or raw rows).
| Input | Description | Required | Default |
|---|---|---|---|
owner | The owner/organization of the repository. | No | ${{ github.event.repository.owner.login }} |
repo | The name of the repository. | No | ${{ github.event.repository.name }} |
pr | The pull request number. | No | ${{ github.event.number }} |
output-type | The format of the output changes. Allowed values: md, markdown, html, rows, json. | No | md |
pr-title | The pull request title, used in the summary output. | No | ${{ github.event.pull_request.title }} |
| Output | Description |
|---|---|
value | The formatted change details matching the requested output-type. |
total | The total number of changes (Merged PRs + Hotfixes) found. |
numOfMerged | The number of merged pull requests. |
numOfHotfix | The number of hotfix commits. |
summary | A short text summary of the changes, prefixing the PR title. |
See action.yml
This example fetches changes for the current pull request and adds a comment containing the change details.
on:
pull_request:
branches:
- "releases/*"# or whatever ex: `main`jobs:
comment-pr-changes:
name: Comment PR changesruns-on: ubuntu-latestpermissions:
pull-requests: write # required to post comments on PRssteps:
- name: Checkout Repositoryuses: actions/checkout@v4
- name: Get changesid: changes-tableuses: ClassFunc/what-changes@v3.3with:
output-type: 'md'# or 'html' or 'rows','json', default: 'md'
- name: Add PR commentuses: mshick/add-pr-comment@v3name: Add PR commentwith:
message-id: 'whatchanges'message: | ${{ steps.changes-table.outputs.summary }} Total: ${{ steps.changes-table.outputs.total }} ${{ steps.changes-table.outputs.numOfMerged }} Merged ${{ steps.changes-table.outputs.numOfHotfix }} Hotfix ${{ steps.changes-table.outputs.value }}repo-token: ${{ secrets.GITHUB_TOKEN }}- Upgraded runner environment to Node 20.
- Upgraded package dependencies.
- Migrated linter to ESLint Flat Config.
- Added
summaryoutput for short summary of changes.
- Added
@before logins for mention PR closed by authors.
- Added 3 outputs:
total,numOfMerged, andnumOfHotfix.
The scripts and documentation in this project are released under the MIT License.