1 | # commitlint-azure-pipelines-cli
|
2 |
|
3 | [![Build Status](https://dev.azure.com/princjef/github-ci/_apis/build/status/princjef.commitlint-azure-pipelines-cli?branchName=master)](https://dev.azure.com/princjef/github-ci/_build/latest?definitionId=1&branchName=master)
|
4 | [![Code Coverage](https://img.shields.io/azure-devops/coverage/princjef/github-ci/1.svg)](https://dev.azure.com/princjef/github-ci/_build/latest?definitionId=1&branchName=master&view=codecoverage-tab)
|
5 | [![npm version](https://img.shields.io/npm/v/commitlint-azure-pipelines-cli.svg)](https://npmjs.org/package/commitlint-azure-pipelines-cli)
|
6 |
|
7 | Lint relevant commits for a branch or Pull Request in [Azure Pipelines][] using
|
8 | [commitlint][] with no configuration needed.
|
9 |
|
10 | ## Getting Started
|
11 |
|
12 | Add this package and commitlint to your dev dependencies:
|
13 |
|
14 | ```
|
15 | npm install --save-dev @commitlint/cli commitlint-azure-pipelines-cli
|
16 | ```
|
17 |
|
18 | Then, in your `azure-pipelines.yml` file, add a step to invoke it:
|
19 |
|
20 | ```yml
|
21 | steps:
|
22 | # Other steps (e.g. install, setup)
|
23 | - script: ./node_modules/.bin/commitlint-azure-pipelines
|
24 | ```
|
25 |
|
26 | Alternatively, you can add a standalone job for running commitlint:
|
27 |
|
28 | ```yml
|
29 | jobs:
|
30 | - job: commitlint
|
31 | pool:
|
32 | vmImage: 'ubuntu-16.04'
|
33 | steps:
|
34 | - task: NodeTool@0
|
35 | inputs:
|
36 | versionSpec: 10.x
|
37 | - script: npm ci
|
38 | - script: ./node_modules/.bin/commitlint-azure-pipelines
|
39 | name: Lint commits
|
40 | ```
|
41 |
|
42 | ## Compatibility
|
43 |
|
44 | This package is only tested against Node.js 10.x and up. This task is tested
|
45 | against all of the hosted operating systems (win, mac, linux).
|
46 |
|
47 | [azure pipelines]: https://azure.microsoft.com/en-us/services/devops/pipelines/
|
48 | [commitlint]: https://github.com/conventional-changelog/commitlint
|