Skip to content

Commit

Permalink
refactor(gitlab): fix param name in gitlab api
Browse files Browse the repository at this point in the history
  • Loading branch information
xuchaoying committed Jun 14, 2018
1 parent 2b0e0fc commit 2cc8e99
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
15 changes: 12 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
"bin": {
"all-contributors": "dist/cli.js"
},
"files": ["dist"],
"files": [
"dist"
],
"engines": {
"node": ">=4"
},
Expand All @@ -21,7 +23,10 @@
"type": "git",
"url": "https://github.com/jfmengels/all-contributors-cli.git"
},
"keywords": ["all-contributors", "contributors"],
"keywords": [
"all-contributors",
"contributors"
],
"author": "Jeroen Engels <[email protected]>",
"license": "MIT",
"bugs": {
Expand All @@ -41,7 +46,11 @@
"kcd-scripts": "^0.29.0",
"nock": "^9.1.0"
},
"eslintIgnore": ["node_modules", "coverage", "dist"],
"eslintIgnore": [
"node_modules",
"coverage",
"dist"
],
"eslintConfig": {
"extends": "./node_modules/kcd-scripts/eslint.js",
"rules": {
Expand Down
2 changes: 1 addition & 1 deletion src/repo/__tests__/gitlab.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ test('retrieve user from a different gitlab registry', async () => {

test('retrieve user from a gitlab registry that needs a token', async () => {
nock('http://gitlab.needtoken.com:3000')
.get('/api/v4/users?username=nodisplayname&privateToken=faketoken')
.get('/api/v4/users?username=nodisplayname&private_token=faketoken')
.reply(200, [
{
username: 'nodisplayname',
Expand Down
2 changes: 1 addition & 1 deletion src/repo/gitlab.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const request = pify(require('request'))
const addPrivateToken = (url, privateToken = '') => {
if (privateToken === '') return url

return `${url}&privateToken=${privateToken}`
return `${url}&private_token=${privateToken}`
.replace(/\?/g, '&')
.replace('&', '?')
}
Expand Down

0 comments on commit 2cc8e99

Please sign in to comment.