🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more →

@codefresh-io/cf-git-providers

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@codefresh-io/cf-git-providers - npm Package Compare versions

Comparing version

to
0.7.1

@@ -34,2 +34,4 @@ "use strict";

const fs_1 = require("fs");
// eslint-disable-next-line @typescript-eslint/no-var-requires
const CFError = require('cf-errors');
exports.to = async (fn) => {

@@ -112,10 +114,20 @@ try {

}
await git.clone({ fs: nodefs, http, dir, url, onAuth: () => (auth) });
await git.tag({ fs: nodefs, dir, force: true, ref: tag });
// attempt to push the tag to verify write permissions
await git.push({ fs: nodefs, http, dir, force: true, onAuth: () => (auth) });
// delete and push the write check tag
await git.deleteTag({ fs: nodefs, dir, ref: tag });
await git.push({ fs: nodefs, http, dir, force: true, onAuth: () => (auth) });
try {
await git.clone({ fs: nodefs, http, dir, url, onAuth: () => (auth) });
await git.tag({ fs: nodefs, dir, force: true, ref: tag });
// attempt to push the tag to verify write permissions
await git.push({ fs: nodefs, http, dir, force: true, onAuth: () => (auth) });
// delete and push the write check tag
await git.deleteTag({ fs: nodefs, dir, ref: tag });
await git.push({ fs: nodefs, http, dir, force: true, onAuth: () => (auth) });
}
catch (error) {
if (error instanceof git.Errors.HttpError) {
const statusCode = error.data.statusCode;
if (statusCode == 401 || statusCode == 403) {
throw new CFError(`ValidationError: check your token permissions, failed assert write scopes with ${error}`);
}
}
}
};
//# sourceMappingURL=index.js.map
{
"name": "@codefresh-io/cf-git-providers",
"version": "0.7.0",
"version": "0.7.1",
"description": "An NPM module/CLI for interacting with various git providers",

@@ -5,0 +5,0 @@ "keywords": [

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet