Skip to content

Document action's fetch depth requirement #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 7, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,30 @@ If no property is set the changelog will be created from the current commit to t

## Usage

### Environment

#### Working directory

This action is meant to be launched inside a Git repository, thus the current `working-directory` must be set accordingly or it will fail.

#### Checkout depth

Because the changelog is generated from commit history, the action will not work as expected with a shallow fetch of the repository.
So the [`actions/checkout`](https://github.com/actions/checkout) action's default fetch depth of 1 is not suitable.
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:

```yaml
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Create Changelog
uses: arduino/create-changelog@v1
```

### Inputs

The action accepts some properties:

- `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.
Expand Down