This action adds changelog to your pull request. It creates a pull request if it does not exist and fails silently if already exists, it will also update the existing pull request body.
If associated pull request is a resolution to an issue then that issue will be the main item to the changelog list while the pull request will be included as its sub item.
It also supports converting the changelog to a checklist. It can retain items that were already checked/unchecked and restore them when action reruns so no worries losing status.
Create a workflow
name: 'your-workflow-name'
on:
push:
branches:
- main
jobs:
your-job-name
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: enzorenz/pr-notes@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
source-branch: test-branch
target-branch: main
draft: true
title: YOUR PR TITLE
commit-type-grouping: true
with-author: true
To properly pull the correct issues please link them in resolve keyword line using hash (#), example:
For same repository:
Resolves #<issue_number>
Resolves #1234
For different repository:
Resolves <owner>/<repository_name>#<issue_number>
Resolves enzorenz/pr-notes#1234
| Name | Description | Default | Required | Example |
|---|---|---|---|---|
| token | GitHub Token to use for this action | N/A | true | ${{ secrets.GITHUB_TOKEN }} |
| source-branch | Head branch of the pull request | N/A | true | develop |
| target-branch | Base branch of the pull request | N/A | true | master |
| draft | Set created pull request status to draft | false |
false | true |
| title | Title for creating pull request (ignored if PR already exists) | N/A | true | Initial Pull Request |
| body | Body for pull request | empty | false | This is a body |
| resolve-line-keyword | Keyword for detecting the resolve line to retrieve related issue/link (case insensitive) | resolves |
false | resolves |
| list-title | Title for changes list | empty | false | Changelog |
| labels | Labels to add to the PR (comma separated) | N/A | false | test, fix |
| reviewers | Reviewers to request to the PR (comma separated) | N/A | false | username1, username2 |
| assignees | Assignees to add to the PR (comma separated) | N/A | false | username1, username2 |
| commit-type-grouping | Groups commits by prefixes (feat, fix, docs, etc.), see commit types below | false | false | true |
| exclude-keywords | Exclude PRs with similar keywords (comma separated) | N/A | false | first_keyword, second_keyword |
| with-author | Includes commit author in the list | false | false | true |
| with-checkbox | Adds a checkbox to changelog main items making it a checklist | false | false | true |
{
feat: 'Features',
fix: 'Bug Fixes',
docs: 'Documentation',
style: 'Styles',
refactor: 'Code Refactoring',
perf: 'Performance Improvements',
test: 'Tests',
build: 'Builds',
ci: 'Continuous Integrations',
chore: 'Chores',
revert: 'Reverts',
merge: 'Merges',
release: 'Releases',
sync: 'Syncs',
other: 'Others' // for PR titles that does not use prefix
}

