Skip to content
This repository was archived by the owner on Apr 1, 2020. It is now read-only.

Advise how to fix #4

Merged
merged 8 commits into from
Dec 18, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,6 @@ typings/
.env

.vscode/launch.json

# Git To-Dos
.todos.yml
6 changes: 0 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,3 @@ after_success:
branches:
except:
- /^v\d+\.\d+\.\d+$/
deploy:
script: scripts/deploy.sh
provider: script
skip_cleanup: true
on:
branch: master
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# commitlint-bot
# commitlint [bot]


[![Travis](https://img.shields.io/travis/ahmed-taj/commitlint-bot.svg)](https://travis-ci.org/ahmed-taj/commitlint-bot)
[![npm](https://img.shields.io/npm/v/commitlint-bot.svg)](https://www.npmjs.com/package/commitlint-bot)


<p align="center">
<img src="docs/robot.svg" width="256" alt="commitlint logo" />
</p>

> Built with [probot](https://github.com/probot/probot) framework

A GitHub App that runs [commitlint](https://github.com/marionebl/commitlint) over all commits of new or edited pull requests
A GitHub App that runs [commitlint](https://github.com/marionebl/commitlint) against all commits of new or edited pull requests
and sets an appropriate status check.

## Usage
Expand All @@ -27,7 +27,6 @@ Problem details will be reported as a comment like this:

![status-comment-screenshot][]


For best results, enable branch protection (in the repository's settings) and require the `commitlint` status check to pass before merging:

![branch-protection-screenshot][]
Expand Down Expand Up @@ -60,7 +59,8 @@ npm install

## Deployment

This app is deployed on free (and single) [Now](https://now.sh) instance which isn't not suitable for real-world usage, you may need to deploy your own instance of the app. See [docs/deploy.md](./docs/deploy.md) for more info.
See [docs/deploy.md](./docs/deploy.md) for more info.


## Credits

Expand Down
3 changes: 1 addition & 2 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
"repository": "https://github.com/ahmed-taj/commitlint-bot",
"env": {
"PRIVATE_KEY": {
"description":
"the private key of your GitHub App. It must be base64 encoded!"
"description": "the private key of your GitHub App."
},
"APP_ID": {
"description": "the ID of your GitHub App"
Expand Down
16 changes: 13 additions & 3 deletions lib/format.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Formats commitlint report as GitHub status report
*
* @param {Object} report
*
* @param {Object} report
*/
const format = report => {
const { commits } = report
Expand Down Expand Up @@ -29,7 +29,17 @@ const format = report => {
// Summary
const summary = `found ${errorsCount} problems, ${warnsCount} warnings`
if (errorsCount > 0 || warnsCount > 0) {
message = `There were the following issues with this Pull Request\n${message}`
message = `
There were the following issues with this Pull Request

${message}

You may need to [change the commit messages](https://help.github.com/articles/changing-a-commit-message/) to comply with the repository contributing guidelines.

--------

🤖 This comment was generated by [**commitlint[bot]**](https://github.com/ahmed-taj/commitlint-bot). Please report issues [here](https://github.com/ahmed-taj/commitlint-bot/issues). Happy coding!
`
}
return { summary, message }
}
Expand Down
4 changes: 2 additions & 2 deletions lib/lint.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const config = require('./config')
const format = require('./format')

/**
* Runs commitlint over all commits of the pull request and sets an appropriate
* Runs commitlint against all commits of the pull request and sets an appropriate
* status check
*/
const commitlint = async ({ github, payload }) => {
Expand Down Expand Up @@ -53,7 +53,7 @@ const commitlint = async ({ github, payload }) => {
// Final status
await github.repos.createStatus({
...statusInfo,
state: report.valid ? 'success' : 'error',
state: report.valid ? 'success' : 'failure',
description: summary
})
// Write a comment with the details (if any)
Expand Down
14 changes: 0 additions & 14 deletions now.json

This file was deleted.

9 changes: 1 addition & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 2 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
"keywords": ["validate", "commit", "pr", "conventional", "git", "probot-app"],
"main": "index.js",
"scripts": {
"now": "now",
"now-start": "PRIVATE_KEY=$(echo $PRIVATE_KEY | base64 -d) npm start",
"start": "probot run ./index.js",
"test": "mocha",
"semantic-release":
Expand All @@ -24,11 +22,10 @@
"expect": "^1.20.2",
"localtunnel": "^1.8.2",
"mocha": "^3.2.0",
"now": "^8.3.10",
"semantic-release": "^8.2.0"
},
"engines": {
"node": ">=8",
"npm": ">=5"
"node": "8.9.x",
"npm": "5.5.x"
}
}
9 changes: 0 additions & 9 deletions scripts/deploy.sh

This file was deleted.