K-Phoen / semver-release-action

GitHub Action to automatically create SemVer compliant releases based on PR labels.
MIT License
85 stars 38 forks source link

fix(guard) Do not throw error if no labels present #48

Closed jmeridth closed 2 years ago

jmeridth commented 2 years ago

Fixes #46

Previously, if you didn't add any labels to your pull request you'd get an error "no valid semver label found". Not every PR may need to cause a semver label to be created when this github action is included in the workflow.

By checking the label list length, we can determine if there are any labels. If none present, do not throw error.

➜  semver-release-action git:(jm/fix-no-labels-throws-error) make test
go test -mod=vendor ./...
?       github.com/K-Phoen/semver-release-action    [no test files]
?       github.com/K-Phoen/semver-release-action/internal/pkg/action    [no test files]
ok      github.com/K-Phoen/semver-release-action/internal/pkg/event 0.842s
?       github.com/K-Phoen/semver-release-action/internal/pkg/git   [no test files]
?       github.com/K-Phoen/semver-release-action/internal/pkg/release   [no test files]
ok      github.com/K-Phoen/semver-release-action/internal/pkg/semver    0.429s

Note the 0.842s test run for pkg/event, that is the new test I've added

Signed-off-by: jmeridth jmeridth@gmail.com

jmeridth commented 2 years ago

~Closing this as this repository is no longer active and author has not responded here or via direct email. Going to fork and use our own version. Cheers.~

Author seems to be interacting with repository again. 😄

jmeridth commented 2 years ago

@K-Phoen Please review.

jmeridth commented 2 years ago

@K-Phoen bump

jmeridth commented 2 years ago

@K-Phoen final bump. Then I'm done. Guess if you "motivate" the author to interact with his repo, he'll just ignore you. Shame.