Skip to content

Commit

Permalink
ghactions: Adjust action so that versioning works
Browse files Browse the repository at this point in the history
For `git describe` to work on non-tag pushes, we need the repo
history/tags, a shallow clone with just the latest commit won't be
enough.

There's also a bug in actions/checkout for tag pushes, the tag
is overridden with a non-tag, which breaks `git describe` for the tag.
This commit adds a workaround for this.

Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
  • Loading branch information
cfergeau committed Jan 24, 2024
1 parent 206bfd4 commit a6e2d5d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@ jobs:
steps:
- name: Check out repository code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: >-
WORKAROUND: Fetch tags that points to the revisions
checked-out(actions/checkout#1467)
run: |-
git fetch --tags --force
- name: Set up Go
uses: actions/setup-go@v4
with:
Expand Down

0 comments on commit a6e2d5d

Please sign in to comment.