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 authored and srueg committed Jun 22, 2020
1 parent f51b91d commit 7d3b761
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ jobs:
env:
IMAGE: docker.io/${{ github.repository }}
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
with:
fetch-depth: "0"
- 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 7d3b761

Please sign in to comment.