Skip to content

Commit

Permalink
(cake-contribGH-704) added `git fetch --prune --unshallow"
Browse files Browse the repository at this point in the history
to the list of steps and explained why that is needed.
  • Loading branch information
nils-a committed Jan 5, 2021
1 parent 6989420 commit 44bf7e3
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions docs/input/docs/ci-systems/github.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ Description: Building with GitHub Actions

* `actions/checkout`

The default for `fetch-depth` is `1` - this currently does not work with `GitVersion`. Set `fetch-depth: 0` to fetch all history for all branches.
The default for `fetch-depth` is `1` - this currently does not work with `GitVersion`.
Additionally information on different tags and branches is needed on some occasions
(like building from a tag which does happen when releasing a new version.)

Therefore it is required to "unshallow" the checked out repository by adding a manual
step: `git fetch --prune --unshallow`

## Example Config

Expand All @@ -27,9 +32,11 @@ jobs:
runs-on: windows-latest

steps:
- uses: actions/checkout@v2.2.0
with:
fetch-depth: 0
- name: Checkout the repository
uses: actions/checkout@v2

- name: Fetch all tags and branches
run: git fetch --prune --unshallow

- name: Cache Tools
uses: actions/cache@v2
Expand Down

0 comments on commit 44bf7e3

Please sign in to comment.