Skip to content
git-commit

GitHub Action

get-commit-changelog

v1.1.1 Latest version

get-commit-changelog

git-commit

get-commit-changelog

List commits between two commits as output

Installation

Copy and paste the following snippet into your .yml file.

              

- name: get-commit-changelog

uses: simenandre/get-commit-changelog@v1.1.1

Learn more about this action in simenandre/get-commit-changelog

Choose a version

get-commit-changelog

This action returns a list of commits between two commits as an output. This is useful when creating a changelog between two commits, such as when deploying something new to the servers, you might wanna give that a changelog. If you keep tabs of your head and base commits, this action might be useful for you!

Features

  • Uses composite action
  • base and head can be typical container tags (e.g. branchname-69b7ea), because this action reads everything after a hyphen (-). Meaning, if you set base to branchname-69b7ea, it becomes 69b7ea.
  • Can be used with other repositories 📂
  • Returns Markdown ✍️

Important: You must use a personal access token with repo scope if you're reading other repositories.

Quickstart

- uses: cobraz/get-commit-changelog@v1
  id: changelog
  with:
    base: ${{ steps.something.base }}

Example

- uses: cobraz/get-commit-changelog@v1
  id: changelog
  with:
    base: ${{ steps.something.base }}
- name: Print changelog
  run: echo "${{ steps.changelog.outputs.changelog }}"

Also, check out the test.yml for a real, working example. In this I have manually set the base to the first commit in this repository. In theory, the changelog will contain all commits in this repository. Check out the actions tab for example runs.

Inputs

  • base (required) is the typically the latest commit (the to commit in our example).
  • head (defaults to github.ref) is typically the commit back in time.
  • token (defaults to github.token) is the GitHub token. It needs to be a personal GitHub token if you are trying to compare other repositories.
  • repository (defaults to github.repository) is which GitHub repository you want to compare commits in.