Skip to content

Commit

Permalink
Explicitly use tags for describing version in CI (OpenRCT2#23190)
Browse files Browse the repository at this point in the history
While we use annotated tags for releases, apparently GitHub Actions
Workers do some peculiar steps for fetching the repository, resulting in
incomplete(?) tag being checked out. The lightweight version of tag is
present, but annotation lives on a different git object, which is not
currently checked out in the CI job. To resolve the issue where GitHub
Actions would try creating a release for a previous tag instead of
current, make sure lightweight tags are considered as well.

You can validate the difference between the two with following commands:
```
$ git rev-parse v0.4.16
20fff63f05dd5508c24bcd2eaf9f34845c7dd472
$ git --no-pager log -1 --oneline v0.4.16
c1082a3 (tag: v0.4.16, origin/master) Release v0.4.16
```
  • Loading branch information
janisozaur authored Nov 14, 2024
1 parent 3e2e8ce commit 850f35f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ jobs:
- name: Git describe
id: ghd
run: |
TAG=$(git describe --abbrev=0)
DESCRIBE=$(git describe)
TAG=$(git describe --tags --abbrev=0)
DESCRIBE=$(git describe --tags)
SHORT_SHA=$(git rev-parse --short HEAD)
DISTANCE=$(git rev-list --count $TAG..HEAD)
echo "tag=$TAG"
Expand Down

0 comments on commit 850f35f

Please sign in to comment.