-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
v1.18.0 — Narrow white rays image colour updated. (#44)
### Added - DangerJS dependency. - DangerJS travis config. - Snyk badge to readme. ### Changed - Narrow white rays image colour updated to be white rather than grey. - Updated dependencies. - Travis runs build on Node v8 & 10. - Package requires Node v8 or above.
- Loading branch information
1 parent
de50403
commit 265e769
Showing
7 changed files
with
2,795 additions
and
721 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* eslint-disable no-console */ | ||
/* global danger, fail, message */ | ||
|
||
const bodyAndTitle = (danger.github.pr.body + danger.github.pr.title).toLowerCase(); | ||
const isTrivial = bodyAndTitle.includes('#trivial'); | ||
|
||
if (!isTrivial) { | ||
// Fail if the title of the PR isn't in the format of a version i.e. vX.X.X (such as v1.4.0) | ||
const versionRegex = /^(v[0-9]+\.[0-9]+\.[0-9]+)/; | ||
const isPRTitleVersioned = danger.github.pr.title.match(versionRegex); | ||
if (!isPRTitleVersioned) { | ||
fail(':exclamation: PR title should start with the package version in the format v(x.x.x) (such as v1.4.0)'); | ||
} | ||
|
||
// Fail if there isn’t a CHANGELOG entry – should update for every PR | ||
if (!danger.git.modified_files.includes('CHANGELOG.md')) { | ||
const changelogLink = 'https://github.com/justeat/f-icons/blob/master/CHANGELOG.md'; | ||
fail(`:memo: Please include a CHANGELOG entry. You can find the current version at <a href="${changelogLink}">CHANGELOG.md</a>`); | ||
} | ||
|
||
// Check for version update | ||
const hasPackageJsonChanged = danger.git.modified_files.includes('package.json'); | ||
const packageDiff = danger.git.JSONDiffForFile('package.json'); | ||
|
||
packageDiff.then(result => { | ||
if (!hasPackageJsonChanged || (hasPackageJsonChanged && !result.version)) { | ||
const semverLink = 'https://docs.npmjs.com/getting-started/semantic-versioning'; | ||
console.log('Versioning Missing'); | ||
console.log(hasPackageJsonChanged, result); | ||
fail(`:exclamation: This PR should include a <a href="${semverLink}">SEMVER</a> version bump, so that it can be published once merged.`); | ||
} | ||
}, err => { | ||
console.log(err); | ||
}); | ||
|
||
// Message on deletions | ||
if (danger.github.pr.deletions > danger.github.pr.additions) { | ||
message(':fire: :clap: You’re a deletion machine!'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.