fix: check correct token var, don’t catch errors so status code is correct
This commit is contained in:
parent
04b5ec4a33
commit
a85a535486
|
@ -15,7 +15,7 @@ const event = JSON.parse(fs.readFileSync('/github/workflow/event.json').toString
|
||||||
let pkg = require(path.join(process.cwd(), 'package.json'))
|
let pkg = require(path.join(process.cwd(), 'package.json'))
|
||||||
|
|
||||||
const run = async () => {
|
const run = async () => {
|
||||||
if (!process.env.NPM_TOKEN) throw new Error('Merge-release requires NPM_TOKEN')
|
if (!process.env.NPM_AUTH_TOKEN) throw new Error('Merge-release requires NPM_AUTH_TOKEN')
|
||||||
let latest
|
let latest
|
||||||
try {
|
try {
|
||||||
latest = await get(pkg.name + '/latest')
|
latest = await get(pkg.name + '/latest')
|
||||||
|
@ -53,4 +53,4 @@ const run = async () => {
|
||||||
process.stdout.write(execSync(`npm publish --access=public`))
|
process.stdout.write(execSync(`npm publish --access=public`))
|
||||||
process.stdout.write(execSync(`git checkout package.json`))
|
process.stdout.write(execSync(`git checkout package.json`))
|
||||||
}
|
}
|
||||||
run().catch(console.error)
|
run()
|
||||||
|
|
Loading…
Reference in New Issue