Skip to content

Commit f6c6a4d

Browse files
committed
feat: initial commit
0 parents  commit f6c6a4d

15 files changed

+11378
-0
lines changed

.gitignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Node.js
2+
node_modules/
3+
4+
# Build output
5+
/dist/
6+
7+
# Pack output
8+
*.tgz
9+
10+
# Test output
11+
/coverage/
12+
/junit.xml

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CHANGELOG.md

.prettierrc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
singleQuote: true
2+
proseWrap: always

LICENSE.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
MIT License
2+
3+
Copyright (c) 2019 Jeffrey Principe
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of
6+
this software and associated documentation files (the "Software"), to deal in
7+
the Software without restriction, including without limitation the rights to
8+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9+
the Software, and to permit persons to whom the Software is furnished to do so,
10+
subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# commitlint-azure-pipelines-cli
2+
3+
Lint relevant commits for a branch or Pull Request in [Azure Pipelines][] using
4+
[commitlint][] with no configuration needed.
5+
6+
## Getting Started
7+
8+
Add this package and commitlint to your dev dependencies:
9+
10+
```
11+
npm install --save-dev @commitlint/cli commitlint-azure-pipelines-cli
12+
```
13+
14+
Then, in your `azure-pipelines.yml` file, add a step to invoke it:
15+
16+
```yml
17+
steps:
18+
# Other steps (e.g. install, setup)
19+
- script: ./node_modules/.bin/commitlint-azure-pipelines
20+
```
21+
22+
Alternatively, you can add a standalone job for running commitlint:
23+
24+
```yml
25+
jobs:
26+
- job: commitlint
27+
pool:
28+
vmImage: 'ubuntu-16.04'
29+
steps:
30+
- task: NodeTool@0
31+
inputs:
32+
versionSpec: 10.x
33+
- script: npm ci
34+
- script: ./node_modules/.bin/commitlint-azure-pipelines
35+
name: Lint commits
36+
```
37+
38+
## Compatibility
39+
40+
This package is only tested against the latest Node.js LTS release. Make sure
41+
you select the latest LTS release for your commitlint step/job. This task is
42+
tested against all of the hosted operating systems (win, mac, linux).
43+
44+
[azure pipelines]: https://azure.microsoft.com/en-us/services/devops/pipelines/
45+
[commitlint]: https://github.com/conventional-changelog/commitlint

azure-pipelines.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
variables:
2+
- group: semantic-release
3+
4+
trigger:
5+
- master
6+
7+
pr:
8+
- master
9+
10+
jobs:
11+
- job: commitlint
12+
pool:
13+
vmImage: 'ubuntu-16.04'
14+
steps:
15+
- task: NodeTool@0
16+
inputs:
17+
versionSpec: 10.x
18+
displayName: Use Node.js 10
19+
- script: npm ci
20+
displayName: Install Dependencies
21+
- script: npm run build
22+
displayName: Build
23+
- script: |
24+
chmod a+x ./bin/run
25+
./bin/run
26+
workingDirectory: $(Build.SourcesDirectory)
27+
displayName: Lint Commits
28+
29+
- job: Test
30+
strategy:
31+
matrix:
32+
linux:
33+
imageName: 'ubuntu-16.04'
34+
mac:
35+
imageName: 'macos-10.13'
36+
windows:
37+
imageName: 'vs2017-win2016'
38+
pool:
39+
vmImage: $(imageName)
40+
steps:
41+
- task: NodeTool@0
42+
inputs:
43+
versionSpec: 10.x
44+
displayName: Use Node.js 10
45+
- script: npm ci
46+
displayName: Install Dependencies
47+
- script: npm test
48+
displayName: Run Tests
49+
- task: PublishTestResults@2
50+
condition: succeededOrFailed()
51+
inputs:
52+
testRunner: JUnit
53+
testResultsFiles: junit.xml
54+
- task: PublishCodeCoverageResults@1
55+
inputs:
56+
codeCoverageTool: Cobertura
57+
summaryFileLocation: coverage/cobertura-coverage.xml
58+
reportDirectory: coverage
59+
60+
- job: publish
61+
dependsOn:
62+
- commitlint
63+
- test
64+
pool:
65+
vmImage: 'ubuntu-16.04'
66+
condition: and(succeeded(), in(variables['Build.Reason'], 'Manual', 'IndividualCI', 'BatchedCI'), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
67+
steps:
68+
- task: NodeTool@0
69+
inputs:
70+
versionSpec: 10.x
71+
displayName: Use Node.js 10
72+
- script: npm ci
73+
displayName: Install Dependencies
74+
- script: npm run release
75+
env:
76+
GH_TOKEN: $(GH_TOKEN)
77+
NPM_TOKEN: $(NPM_TOKEN)
78+
displayName: Publish to NPM

bin/run

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env node
2+
3+
require('../dist').default().catch(err => {
4+
console.log(err);
5+
process.exit(1);
6+
});
7+

bin/run.cmd

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@echo off
2+
3+
node "%~dp0\run" %*

lib.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
declare module '@commitlint/cli';

0 commit comments

Comments
 (0)