Skip to content

Commit 6530751

Browse files
committed
fix: if condition
1 parent 03f8143 commit 6530751

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

.github/workflows/release.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
type: choice
88
description: "Release Npm Tag"
99
required: true
10-
default: "latest"
10+
default: "nightly"
1111
options:
1212
- canary
1313
- nightly
@@ -58,9 +58,9 @@ jobs:
5858
run: pnpm run test
5959

6060
- name: Dry run release to npm
61-
if: inputs.dry_run == 'true'
62-
run: node scripts/release.js --dry-run --tag ${{ github.event.inputs.tag }}
61+
if: inputs.dry_run
62+
run: node scripts/release.mjs --dry-run --tag ${{ inputs.tag }}
6363

64-
- name: Dry run release to npm
65-
if: inputs.dry_run == 'false'
66-
run: node scripts/release.js --tag ${{ github.event.inputs.tag }}
64+
- name: Release to npm
65+
if: ${{ !inputs.dry_run }}
66+
run: node scripts/release.mjs --tag ${{ inputs.tag }}

scripts/release.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import path from 'path';
22
import * as url from 'url';
33
import cac from 'cac';
4-
import { $ } from 'execa';
4+
import {$} from 'execa';
55
import fs from 'fs-extra';
66

77
let cli = cac('release');
@@ -25,14 +25,14 @@ const parsed = cli.parse();
2525
const npmTag = parsed.options.tag;
2626
const isDryRun = parsed.options.dryRun;
2727

28-
const allowedTags = ['latest', 'canary', 'alpha', 'beta', 'rc'];
28+
const allowedTags = ['latest', 'canary', 'alpha', 'beta', 'rc', 'nightly'];
2929
if (!allowedTags.includes(npmTag)) {
3030
throw new Error(
3131
`Invalid npm tag: ${npmTag}. Allowed tags: ${allowedTags.join(', ')}`,
3232
);
3333
}
3434

35-
const prereleaseTags = ['alpha', 'beta', 'rc', 'canary'];
35+
const prereleaseTags = ['alpha', 'beta', 'rc', 'canary', 'nightly'];
3636
if (
3737
npmTag === 'latest' &&
3838
prereleaseTags.some((tag) => publishVersion.includes(tag))

0 commit comments

Comments
 (0)