Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
renovate
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GitHub Mirror
Renovate Bot
renovate
Commits
28ffae2e
Commit
28ffae2e
authored
8 years ago
by
Rhys Arkins
Browse files
Options
Downloads
Patches
Plain Diff
Improve comments
parent
41f20487
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/index.js
+6
-0
6 additions, 0 deletions
src/index.js
src/npm.js
+7
-2
7 additions, 2 deletions
src/npm.js
with
13 additions
and
2 deletions
src/index.js
+
6
−
0
View file @
28ffae2e
...
...
@@ -39,14 +39,19 @@ function validateArguments() {
}
function
initializeGitHub
()
{
if
(
config
.
verbose
)
{
console
.
log
(
'
Initializing GitHub
'
);
}
return
github
.
init
(
token
,
repoName
,
config
.
baseBranch
,
config
.
verbose
);
}
function
getPackageFileContents
()
{
console
.
log
(
'
Getting package file contents
'
);
return
github
.
getFileContents
(
packageFile
);
}
function
determineUpgrades
(
packageFileContents
)
{
console
.
log
(
'
Determining required upgrades
'
);
return
npm
.
getAllDependencyUpgrades
(
packageFileContents
);
}
...
...
@@ -77,6 +82,7 @@ function updateDependency(depType, depName, currentVersion, nextVersion) {
const
commitMessage
=
config
.
templates
.
commitMessage
({
depName
,
currentVersion
,
nextVersion
});
// Check if same PR already existed and skip if so
// This allows users to close an unwanted upgrade PR and not worry about seeing it raised again
return
github
.
checkForClosedPr
(
branchName
,
prTitle
).
then
((
prExisted
)
=>
{
if
(
prExisted
)
{
console
.
log
(
`
${
depName
}
: Skipping due to existing PR found.`
);
...
...
This diff is collapsed.
Click to expand it.
src/npm.js
+
7
−
2
View file @
28ffae2e
...
...
@@ -41,7 +41,9 @@ module.exports = {
allDependencyChecks
.
push
(
getDependencyUpgrades
(
depName
,
currentVersion
)
.
then
(
res
=>
{
if
(
Object
.
keys
(
res
).
length
>
0
)
{
console
.
log
(
`
${
depName
}
upgrades:
${
JSON
.
stringify
(
res
)}
`
);
if
(
config
.
verbose
)
{
console
.
log
(
`
${
depName
}
: Upgrades =
${
JSON
.
stringify
(
res
)}
`
);
}
Object
.
keys
(
res
).
forEach
(
function
(
majorVersion
)
{
allDependencyUpgrades
.
push
({
depType
:
depType
,
...
...
@@ -50,7 +52,10 @@ module.exports = {
nextVersion
:
res
[
majorVersion
],
});
});
}
else
{
if
(
config
.
verbose
)
{
console
.
log
(
`
${
depName
}
: No upgrades required`
);
}
}
}));
});
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment