Skip to content

Commit

Permalink
Explictly fetch the whole Git history when building Docker image for PR
Browse files Browse the repository at this point in the history
Otherwise, `actions/checkout@v2` will only fetch the latest commit,
leaving `git describe` unable to produce a useful version, cf.
actions/checkout#100 and
actions/checkout#217

Also switch to `actions/checkout@v2` when building the master branch and
release Docker images.
  • Loading branch information
simu committed Jun 15, 2020
1 parent 040c1ff commit 2e2d4c1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ jobs:
env:
IMAGE: docker.io/${{ github.repository }}
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
with:
fetch-depth: "0"
- name: Fetch tags
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- name: Set image version latest
if: github.ref == 'refs/heads/master'
run: echo ::set-env name=VERSION::latest
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: "0"
- name: Build image
env:
VERSION: v0.0.0+test
run: make docker
build-component-test:
runs-on: ubuntu-latest
Expand Down

0 comments on commit 2e2d4c1

Please sign in to comment.