screwdriver-api 4.1.212 → 4.1.213
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/plugins/pipelines/create.js +15 -6
package/package.json
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
const boom = require('@hapi/boom');
|
|
4
4
|
const schema = require('screwdriver-data-schema');
|
|
5
5
|
const urlLib = require('url');
|
|
6
|
+
const logger = require('screwdriver-logger');
|
|
6
7
|
const { formatCheckoutUrl, sanitizeRootDir } = require('./helper');
|
|
7
8
|
const { getUserPermissions } = require('../helper');
|
|
8
9
|
const ANNOTATION_USE_DEPLOY_KEY = 'screwdriver.cd/useDeployKey';
|
|
@@ -30,12 +31,20 @@ module.exports = () => ({
|
|
|
30
31
|
// fetch the user
|
|
31
32
|
const user = await userFactory.get({ username, scmContext });
|
|
32
33
|
const token = await user.unsealToken();
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
34
|
+
|
|
35
|
+
let scmUri;
|
|
36
|
+
|
|
37
|
+
try {
|
|
38
|
+
scmUri = await pipelineFactory.scm.parseUrl({
|
|
39
|
+
scmContext,
|
|
40
|
+
rootDir,
|
|
41
|
+
checkoutUrl,
|
|
42
|
+
token
|
|
43
|
+
});
|
|
44
|
+
} catch (error) {
|
|
45
|
+
logger.error(error.message);
|
|
46
|
+
throw boom.boomify(error, { statusCode: error.statusCode });
|
|
47
|
+
}
|
|
39
48
|
|
|
40
49
|
// get the user permissions for the repo
|
|
41
50
|
await getUserPermissions({ user, scmUri });
|