Skip to content

Commit 4e38a94

Browse files
Fix release script once again (#4323)
- **PR Description** I have no regrets about testing this script one PR at a time. - **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 49f2f81 + 471f72e commit 4e38a94

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

Diff for: .github/workflows/release.yml

+13-1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ jobs:
3333
- name: Get Latest Tag
3434
run: |
3535
latest_tag=$(git describe --tags $(git rev-list --tags --max-count=1) || echo "v0.0.0")
36+
37+
if ! [[ $latest_tag =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
38+
echo "Error: Tag format is invalid. Expected format: vX.X.X"
39+
exit 1
40+
fi
41+
3642
echo "Latest tag: $latest_tag"
3743
echo "latest_tag=$latest_tag" >> $GITHUB_ENV
3844
@@ -90,7 +96,13 @@ jobs:
9096
patch=0
9197
fi
9298
93-
new_tag="v$major.$minor.$patch"
99+
new_tag="$major.$minor.$patch"
100+
101+
if ! [[ $new_tag =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
102+
echo "Error: New tag's format is invalid. Expected format: vX.X.X"
103+
exit 1
104+
fi
105+
94106
echo "New tag: $new_tag"
95107
echo "new_tag=$new_tag" >> $GITHUB_ENV
96108

0 commit comments

Comments
 (0)