Skip to content

Commit 455a211

Browse files
committed
Add documentation
1 parent 4ccba91 commit 455a211

File tree

3 files changed

+58
-11
lines changed

3 files changed

+58
-11
lines changed

README.md

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,46 @@
1-
# create-changelog
1+
# Create Changelog
22

33
[![Actions Status](https://github.com/arduino/create-changelog/workflows/Test%20Action/badge.svg)](https://github.com/arduino/create-changelog/actions)
44

5-
This actions create
5+
This actions is an highly opinionated tool that creates changelogs from the git repository commit history.
6+
7+
If no property is set the changelog will be created from the current commit to the previous existing tag or the first commit.
68

79
## Usage
810

9-
TODO
11+
This action is meant to be launched inside a Git repository, thus the current `working-directory` must be set accordingly or it will fail.
12+
13+
The action accepts some properties:
14+
15+
- `tag-regex` to pick which tags are taken into consideration to create the changelog, the example below would ignore all tags except those matching it, `0.0.1` would be accepted but `v0.0.1` or `0.0.1-rc` would be ignored.
16+
By default any tag is used.
17+
18+
```
19+
- name: Create Changelog
20+
uses: arduino/create-changelog@v1
21+
with:
22+
tag-regex: '^[0-9]+\.[0-9]+\.[0-9]+$'
23+
```
24+
25+
- `filter-regex` to skip certain commmits based on their message, the example below would skip all commits that start with the `[skip]` string.
26+
By default no commit is skipped.
27+
28+
```
29+
- name: Create Changelog
30+
uses: arduino/create-changelog@v1
31+
with:
32+
filter-regex: '^\[skip\].*'
33+
```
34+
35+
- `changelog-file-path` to select the path and the name of the changelog file to be saved, the example below would save a `MyChangelog.md` file to the current `working-directory`.
36+
By default `CHANGELOG.md` is used.
37+
38+
```
39+
- name: Create Changelog
40+
uses: arduino/create-changelog@v1
41+
with:
42+
changelog-file-path: 'MyChangelog.md'
43+
```
1044

1145
## Development
1246

action.yml

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
1-
name: "Create changelog"
2-
description: "Generates a changelog from a Git repository commit history."
3-
author: "Arduino"
1+
name: 'Create changelog'
2+
description: 'Generates a changelog from a Git repository commit history.'
3+
author: 'Arduino'
44
runs:
5-
using: "node12"
6-
main: "dist/index.js"
5+
using: 'node12'
6+
main: 'dist/index.js'
77
branding:
8-
icon: "list"
9-
color: "blue"
8+
icon: 'list'
9+
color: 'blue'
10+
inputs:
11+
tag-regex:
12+
description: 'Regex to select git tags used as boundaries for the changelog.'
13+
default: ''
14+
filter-regex:
15+
description: 'Regex to filter out commit messages from the changelog.'
16+
default: ''
17+
changelog-file-path:
18+
description: 'Destination file of the generated changelog.'
19+
default: 'CHANGELOG.md'

src/settings.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@ import * as core from '@actions/core'
22
import * as io from '@actions/io'
33

44
export interface Settings {
5-
// TODO: DOCS
5+
// Path to git executable
66
gitPath: string
7+
// Regex to select git tags used as boundaries for the changelog
78
tagRegex: string | RegExp
9+
// Regex to filter out commit messages from the changelog
810
filterRegex: string | RegExp
11+
// Destination file of the generated changelog
912
changelogFilePath: string
1013
}
1114

0 commit comments

Comments
 (0)