Skip to content

Commit 6636d0c

Browse files
Fix auto-release workflow (#4265)
The latest_tag env var wasn't defined when it was used. - **PR Description** - **Please check if the PR fulfills these requirements** * [ ] Cheatsheets are up-to-date (run `go generate ./...`) * [ ] Code has been formatted (see [here](https://github.com/jesseduffield/lazygit/blob/master/CONTRIBUTING.md#code-formatting)) * [ ] Tests have been added/updated (see [here](https://github.com/jesseduffield/lazygit/blob/master/pkg/integration/README.md) for the integration test guide) * [ ] Text is internationalised (see [here](https://github.com/jesseduffield/lazygit/blob/master/CONTRIBUTING.md#internationalisation)) * [ ] If a new UserConfig entry was added, make sure it can be hot-reloaded (see [here](https://github.com/jesseduffield/lazygit/blob/master/docs/dev/Codebase_Guide.md#using-userconfig)) * [ ] Docs have been updated if necessary * [ ] You've read through your own file changes for silly mistakes etc <!-- Be sure to name your PR with an imperative e.g. 'Add worktrees view' see https://github.com/jesseduffield/lazygit/releases/tag/v0.40.0 for examples -->
2 parents dcf264b + 269d89e commit 6636d0c

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

.github/workflows/release.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ jobs:
1616
with:
1717
fetch-depth: 0
1818

19+
- name: Get Latest Tag
20+
run: |
21+
latest_tag=$(git describe --tags $(git rev-list --tags --max-count=1) || echo "v0.0.0")
22+
echo "Latest tag: $latest_tag"
23+
echo "latest_tag=$latest_tag" >> $GITHUB_ENV
24+
1925
- name: Check for changes since last release
2026
run: |
2127
if [ -z "$(git diff --name-only ${{ env.latest_tag }})" ]; then
@@ -53,9 +59,8 @@ jobs:
5359

5460
- name: Calculate next version
5561
run: |
56-
latest_tag=$(git describe --tags $(git rev-list --tags --max-count=1) || echo "v0.0.0")
57-
echo "Latest tag: $latest_tag"
58-
IFS='.' read -r major minor patch <<< "$latest_tag"
62+
echo "Latest tag: ${{ env.latest_tag }}"
63+
IFS='.' read -r major minor patch <<< "${{ env.latest_tag }}"
5964
new_minor=$((minor + 1))
6065
new_tag="$major.$new_minor.0"
6166
echo "New tag: $new_tag"

0 commit comments

Comments
 (0)