|
|
|
@ -15,19 +15,21 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
|
|
return result;
|
|
|
|
|
};
|
|
|
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
|
|
const core = __importStar(require("@actions/core"));
|
|
|
|
|
const path = __importStar(require("path"));
|
|
|
|
|
const exec = __importStar(require("@actions/exec"));
|
|
|
|
|
function configAuth(registryUrl) {
|
|
|
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
|
|
|
let npmrc = path.resolve(process.cwd(), '.npmrc');
|
|
|
|
|
let yarnrc = path.resolve(process.cwd(), '.yarnrc');
|
|
|
|
|
writeRegistryToFile(registryUrl, 'npm', 'NPM_TOKEN');
|
|
|
|
|
writeRegistryToFile(registryUrl, 'yarn', 'YARN_TOKEN');
|
|
|
|
|
yield writeRegistryToFile(registryUrl, 'npm', 'NPM_TOKEN');
|
|
|
|
|
// writeRegistryToFile(registryUrl, 'yarn', 'YARN_TOKEN');
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
exports.configAuth = configAuth;
|
|
|
|
|
function writeRegistryToFile(registryUrl, packageManager, authTokenName) {
|
|
|
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
|
|
|
core.debug(`Setting up ${packageManager} auth`);
|
|
|
|
|
yield exec.exec(`${packageManager} config set registry=${registryUrl}`);
|
|
|
|
|
yield exec.exec(`${packageManager} config set always-auth=true`);
|
|
|
|
|
yield exec.exec(packageManager +
|
|
|
|
|