Skip to content

Commit

Permalink
a new feature or fix need to be a new version
Browse files Browse the repository at this point in the history
  • Loading branch information
joanestebanr committed Jun 11, 2024
1 parent 703e096 commit e66446b
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/check_version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Check Version
on:
push:
branches:
- 'release/**'
- 'feature/**'
- 'fix/**'
pull_request:
jobs:
check_version:
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.21.x
- name: Checkout code
uses: actions/checkout@v4
- name: Check Version
run: make check-is-new-version
11 changes: 9 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,15 @@ install-linter: ## Installs the linter
lint: ## Runs the linter
export "GOROOT=$$(go env GOROOT)" && $$(go env GOPATH)/bin/golangci-lint run --timeout=5m



.PHONY: lint
check-is-new-version: ## Checks if the version is new or already exists
@export VERSION=$$(go run ./cmd/ --version | cut -f 3 -d ' ') ; \
echo "current version: $$VERSION" ; \
if [ -z "$$VERSION" ]; then echo "Error: Version is empty" && exit 1; fi ; \
git tag -l $$VERSION | grep $$VERSION ; \
if [ $$? -eq 0 ]; then echo "Error: Version already exists"; exit 1; fi ; \
echo "Version is new"



.PHONY: update-external-dependencies
Expand Down

0 comments on commit e66446b

Please sign in to comment.