Comments (5)
Just spotted semantic-release/semantic-release#536 - I guess this is one way to solve it.
from commit-analyzer.
For using an external is the solution.
If it were to be implemented in semantic-release it would be as verifyRelease
plugin.
semantic-release doesn't run on PR currently, for reasons explained in #585.
Throwing an error when there is no commits matching a rule is probably not a good idea, as running when no new commit has been added since the last release is a valid use case.
from commit-analyzer.
Duplicate of semantic-release/semantic-release#536
from commit-analyzer.
semantic-release doesn't run on PR currently, for reasons explained in #585.
Thanks, looks like I've got some reading to do, although in a non-public, non-Travis setup it might just work. Even with a missing token on Travis PR build, you could still in theory use semantic-release
to validate commits - but I'll follow that up in #585 once I familiarize myself with things a bit more.
I agree there's some overlap with #536 and I did mention linting, but I do feel that "strict mode" might be a feature of its own. Let me reword a little bit...
Suppose you have commits since last release. Suppose none of these commits match a rule. semantic-release
will silently not make a release. What I'm looking for is semantic-release
instead warning me (by failing a build) that it's not going to make a release, because all commits that it found did not match any rules. This does mean that:
- if there were no new commits - all is good, no failure
- if there are only, say,
docs
commits - all is good, they match a rule, no failure - there are commits, but all of them are untagged - failure; remediate by merging something that has a tag, so that there's an explicit "no release" or "release".
Failing when there's at least one untagged commit is probably a stretch and only useful at PR stage (i.e. lint), as the only way to solve that would be to force push into master, and that's probably a bad idea, so there'd need to be another way to avoid that dead end.
from commit-analyzer.
Validating commits (no matter the exact rules) is a lot more useful to do during the PR stage.
Once the commits are merged to master
and semantic-release runs it's already too late. We could fail the release, but then there is no good solution for the user. Any new commit would trigger a release. The only way would be to rewrite commits on master
which is not something we recommend.
This is why we don't fail on malformed commits. To avoid an inescapable situation.
The proper solution is to validate the commit format during the PR step, either with semantic-release once we have a good solution to run on PR builds or with an external tool.
from commit-analyzer.
Related Issues (20)
- Release type should not be case sensitive HOT 2
- The type field in the release rules doesn't seem to work if there is a space HOT 4
- "Fix: " prefix dominates over "feat: " one if latter used as a second line in commit message HOT 7
- How to pin the commit-analyzer version HOT 5
- Step analyzeCommits suddenly exits 0 without analyzing commits HOT 20
- This plugin just silently quits HOT 4
- promisify crashing node HOT 6
- Providing a PR description breaks custom releaseRules HOT 1
- deps changes do not trigger release HOT 7
- Use @commitlint/config-conventional with the new preset format HOT 3
- [Feature Request] Add feature to pass an already imported conventional_changelog_**** HOT 1
- Cannot find module 'conventional-changelog-*' HOT 8
- Use the standard `conventional-changelog-preset-loader` to load presets HOT 1
- Question: after merging from a prerelease branch into a release branch
- Feature request HOT 1
- Prevent semantic release from being triggered by certain default prefixes HOT 4
- Revert commit is not triggering a new release HOT 4
- Allow custom function in `releaseRules`
- Uppercase scope not triggering a release (anymore) HOT 2
- `The commit should not trigger a release` after recent updates HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from commit-analyzer.