Skip to content

Commit 2cb7992

Browse files
authored
Document action's fetch depth requirement (#11)
The changelog is generated from the commit history. But the ubiquitous `actions/checkout` action does a shallow fetch by default. This works perfectly well for almost every usage, so many users may not even be aware of the shallowness of the resulting repository or the ability to control the behavior via that action's `fetch-depth` input. If you use the default `actions/checkout` configuration in your workflow, the resulting will contain, at most, a single entry. This can be extremely confusing. So the users will likely find some guidance in the required checkout configuration to be valuable.
1 parent a0b1e2f commit 2cb7992

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,30 @@ If no property is set the changelog will be created from the current commit to t
88

99
## Usage
1010

11+
### Environment
12+
13+
#### Working directory
14+
1115
This action is meant to be launched inside a Git repository, thus the current `working-directory` must be set accordingly or it will fail.
1216

17+
#### Checkout depth
18+
19+
Because the changelog is generated from commit history, the action will not work as expected with a shallow fetch of the repository.
20+
So the [`actions/checkout`](https://github.com/actions/checkout) action's default fetch depth of 1 is not suitable.
21+
Set that action's [`fetch-depth` input](https://github.com/actions/checkout#fetch-all-history-for-all-tags-and-branches) to `0` to fetch the full commit history:
22+
23+
```yaml
24+
- name: Checkout repository
25+
uses: actions/checkout@v2
26+
with:
27+
fetch-depth: 0
28+
29+
- name: Create Changelog
30+
uses: arduino/create-changelog@v1
31+
```
32+
33+
### Inputs
34+
1335
The action accepts some properties:
1436
1537
- `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.

0 commit comments

Comments
 (0)