Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const knownOptions = {
version: Boolean,
help: Boolean,
keychain: Boolean,
npm: Boolean,
'ask-for-passwords': Boolean,
'gh-token': String,
'npm-token': String,
Expand Down Expand Up @@ -63,6 +64,7 @@ Options:
--npm-token=<String> npm auth token
--circle-token=<String> CircleCI auth token
--npm-username=<String> npm username
--no-npm Do not setup npm.

Aliases:
init setup`);
Expand All @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/ci.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 4 additions & 0 deletions src/lib/github-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.');
Expand Down