pr-commit-body-action

GitHub action to add commit history to PR body

MIT License

Stars
13
Committers
2

PR Commit Body Action

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

プルリクエスト本文にコミット履歴を追加するGitHub Actionsです。

Table of Contents

スクリーンショット

自動生成された本文

このプルリクエストの本文の一部(赤で囲まれている箇所)は、マージされたPR(緑で囲まれている箇所)とコミット(青で囲まれている箇所)によって自動的に生成されています。

使用方法

  1. ワークフローを設定
    例:
    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. 以下のコメントを含むプルリクエストを作成
    <!-- START pr-commits -->
    <!-- END pr-commits -->
    

Options

name description default required e.g.
CHANGE_TEMPLATE マージされたプルリク用テンプレート * ${TITLE} (#${NUMBER}) @${AUTHOR} - ${TITLE}
COMMIT_TEMPLATE コミット用テンプレート * ${MESSAGE} (${COMMITS}) - ${MESSAGE}
MAX_COMMITS 最大コミット表示数 5 3
TEMPLATE テンプレート ${MERGES}${COMMITS}${BREAKING_CHANGES} true ${MERGES}
COMMIT_TYPES コミットタイプ feat, fix, build, ci, docs, style, perf, refactor, test, chore true feat, fix, chore
EXCLUDE_MESSAGES 除外メッセージ tweaks
TITLE タイトル Changes:
NO_ITEMS アイテムがない時に表示するメッセージ - no item
LINK_ISSUE_KEYWORD プルリクエストを Issue に紐付けるためのキーワードこのオプションが設定されている場合、この値が Issue 参照に付与されます。(例: #234 => closes #123) closes
FILTER_PR Semantic message のルールでプルリクエストをフィルタするかどうか false true
GITHUB_TOKEN アクセストークン ${{github.token}} true ${{secrets.ACCESS_TOKEN}}

Action イベント詳細

対象イベント

eventName action
pull_request, pull_request_target opened, reopened, synchronize

Author

GitHub (Technote) Blog