Skip to content

technote-space/pr-commit-body-action

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

PR Commit Body Action

CI Status codecov CodeFactor License: MIT

Read this in other languages: English, 日本語.

This is a GitHub Actions to add commit history to PR body.

Table of Contents

Details

Screenshots

Auto generated body

pr-body

Part of the body of this PR (enclosed in red) is automatically generated by the merged PRs (enclosed in green) and commits (enclosed in blue).

Usage

  1. Setup workflow
    e.g.
    on:
      pull_request:
        types: [opened, synchronize]
    
    name: Pull Request updated
    
    jobs:
      history:
        name: Pull Request Body
        runs-on: ubuntu-latest
        if: startsWith(github.event.pull_request.head.ref, 'release/')
        steps:
          - name: Pull Request Body
            uses: technote-space/pr-commit-body-action@v1
  2. Create pull request including comment below
    <!-- START pr-commits -->
    <!-- END pr-commits -->

Options

name description default required e.g.
CHANGE_TEMPLATE Merge item template * ${TITLE} (#${NUMBER}) @${AUTHOR} - ${TITLE}
COMMIT_TEMPLATE Commit template * ${MESSAGE} (${COMMITS}) - ${MESSAGE}
MAX_COMMITS Max number to show commits 5 3
TEMPLATE Template ${MERGES}
${COMMITS}
${BREAKING_CHANGES}
true ${MERGES}
COMMIT_TYPES Types feat, fix, build, ci, docs, style, perf, refactor, test, chore true feat, fix, chore
EXCLUDE_MESSAGES Exclude messages tweaks
TITLE Title Changes:
NO_ITEMS Message to show if there are no item - no item
LINK_ISSUE_KEYWORD A keyword linking a pull request to issue.
If this options is set, this value is added to issue references.
(e.g. #234 => closes #123)
closes
FILTER_PR Whether to filter pull requests by semantic message rule false true
GITHUB_TOKEN Access token ${{github.token}} true ${{secrets.ACCESS_TOKEN}}

Action event details

Target events

eventName action
pull_request, pull_request_target opened, reopened, synchronize

Author

GitHub (Technote)
Blog