Skip to content

Commit

Permalink
fix: Ignore private field of lerna root package
Browse files Browse the repository at this point in the history
  • Loading branch information
juliendargelos committed Jan 13, 2021
1 parent 265fa23 commit 7960b83
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
24 changes: 12 additions & 12 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6978,9 +6978,20 @@ __webpack_require__.r(__webpack_exports__);
let cli;
let cliPath;
let release;
try {
await fs__WEBPACK_IMPORTED_MODULE_3__.promises.access('lerna.json');
cli = 'lerna';
release = lernaRelease;
_actions_core__WEBPACK_IMPORTED_MODULE_0__.info('Lerna detected, releasing using lerna');
}
catch (_) {
cli = 'semantic-release';
release = semanticRelease;
_actions_core__WEBPACK_IMPORTED_MODULE_0__.info('Lerna not detected, releasing using semantic-release');
}
try {
const pkg = JSON.parse((await fs__WEBPACK_IMPORTED_MODULE_3__.promises.readFile('package.json')).toString());
privatePackage = pkg.private || false;
privatePackage = cli !== 'lerna' && pkg.private;
scope = pkg.name.slice(0, pkg.name.indexOf('/'));
publishToGithub = publish && !privatePackage && scope === ownerScope;
publishToNPM = publish && !privatePackage && !!npmToken;
Expand All @@ -6991,17 +7002,6 @@ __webpack_require__.r(__webpack_exports__);
publishToGithub = false;
publishToNPM = false;
}
try {
await fs__WEBPACK_IMPORTED_MODULE_3__.promises.access('lerna.json');
cli = 'lerna';
release = lernaRelease;
_actions_core__WEBPACK_IMPORTED_MODULE_0__.info('Lerna detected, releasing using lerna');
}
catch (_) {
cli = 'semantic-release';
release = semanticRelease;
_actions_core__WEBPACK_IMPORTED_MODULE_0__.info('Lerna not detected, releasing using semantic-release');
}
if (!publish) {
_actions_core__WEBPACK_IMPORTED_MODULE_0__.info('Publishing disabled, skipping publishing to package registries');
}
Expand Down
26 changes: 13 additions & 13 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,6 @@ import { promises as fs } from 'fs'
env?: { [variable: string]: string }
) => Promise<void>

try {
const pkg = JSON.parse((await fs.readFile('package.json')).toString())
privatePackage = pkg.private || false
scope = pkg.name.slice(0, pkg.name.indexOf('/'))
publishToGithub = publish && !privatePackage && scope === ownerScope
publishToNPM = publish && !privatePackage && !!npmToken
} catch (_) {
privatePackage = true
scope = ownerScope
publishToGithub = false
publishToNPM = false
}

try {
await fs.access('lerna.json')
cli = 'lerna'
Expand All @@ -54,6 +41,19 @@ import { promises as fs } from 'fs'
)
}

try {
const pkg = JSON.parse((await fs.readFile('package.json')).toString())
privatePackage = cli !== 'lerna' && pkg.private
scope = pkg.name.slice(0, pkg.name.indexOf('/'))
publishToGithub = publish && !privatePackage && scope === ownerScope
publishToNPM = publish && !privatePackage && !!npmToken
} catch (_) {
privatePackage = true
scope = ownerScope
publishToGithub = false
publishToNPM = false
}

if (!publish) {
core.info(
'Publishing disabled, skipping publishing to package registries'
Expand Down

0 comments on commit 7960b83

Please sign in to comment.