diff --git a/src/index.js b/src/index.js index f7a0a9a..4fc9cf0 100644 --- a/src/index.js +++ b/src/index.js @@ -21,6 +21,7 @@ const knownOptions = { version: Boolean, help: Boolean, keychain: Boolean, + npm: Boolean, 'ask-for-passwords': Boolean, 'gh-token': String, 'npm-token': String, @@ -63,6 +64,7 @@ Options: --npm-token= npm auth token --circle-token= CircleCI auth token --npm-username= npm username + --no-npm Do not setup npm. Aliases: init setup`); @@ -84,7 +86,9 @@ Aliases: try { await require('./lib/repository')(pkg, info); - await require('./lib/npm')(pkg, info); + if (info.options.npm) { + await require('./lib/npm')(pkg, info); + } await require('./lib/github')(info); await require('./lib/ci')(pkg, info); } catch (error) { diff --git a/src/lib/ci.js b/src/lib/ci.js index de8d171..99db933 100644 --- a/src/lib/ci.js +++ b/src/lib/ci.js @@ -17,7 +17,7 @@ const cis = { const message = ` ${_.repeat('-', 46)} GH_TOKEN=${info.github.token} -NPM_TOKEN=${info.npm.token} +${info.options.npm ? "NPM_TOKEN=" + info.npm.token : ""} ${_.repeat('-', 46)} `; console.log(message); diff --git a/src/lib/github-actions.js b/src/lib/github-actions.js index 841e2fd..ec8da77 100644 --- a/src/lib/github-actions.js +++ b/src/lib/github-actions.js @@ -84,6 +84,10 @@ async function createSecret(info) { } module.exports = async function (pkg, info) { + if(!info.options.npm){ + log.info('Skipping creation of GitHub Actions NPM_TOKEN secret.'); + return; + } await createSecret(info); log.info('Successfully created GitHub Actions NPM_TOKEN secret.');