Skip to content
Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

what-changes actions

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).

Continuous IntegrationCoverageLicense: MIT


Inputs

InputDescriptionRequiredDefault
ownerThe owner/organization of the repository.No${{ github.event.repository.owner.login }}
repoThe name of the repository.No${{ github.event.repository.name }}
prThe pull request number.No${{ github.event.number }}
output-typeThe format of the output changes. Allowed values: md, markdown, html, rows, json.Nomd
pr-titleThe pull request title, used in the summary output.No${{ github.event.pull_request.title }}

Outputs

OutputDescription
valueThe formatted change details matching the requested output-type.
totalThe total number of changes (Merged PRs + Hotfixes) found.
numOfMergedThe number of merged pull requests.
numOfHotfixThe number of hotfix commits.
summaryA short text summary of the changes, prefixing the PR title.

Usage

See action.yml

Example: Query changes between branches & post as comment

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 }}

Change Log

v3.3

  • Upgraded runner environment to Node 20.
  • Upgraded package dependencies.
  • Migrated linter to ESLint Flat Config.

v3.2

  • Added summary output for short summary of changes.

v3.1

  • Added @ before logins for mention PR closed by authors.

v3.0

  • Added 3 outputs: total, numOfMerged, and numOfHotfix.

License

The scripts and documentation in this project are released under the MIT License.

About

Report what changes within branches

Resources

Stars

1 star

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages