Skip to content

Commit a6d76a1

Browse files
Added "tag" and "scope" input and output variables
1 parent 7ac97fa commit a6d76a1

File tree

4 files changed

+52
-12
lines changed

4 files changed

+52
-12
lines changed

action.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,27 @@ inputs:
2424
required: false
2525
default: package.json
2626

27-
check-version:
28-
description: Only publish if the version in package.json differs from the latest on NPM
27+
tag:
28+
description: The tag to publish to. This allows people to install the package using "npm install <package-name>@<tag>".
29+
required: false
30+
default: "latest"
31+
32+
access:
33+
description:
34+
Determines whether the published package should be publicly visible, or restricted to members of your NPM organization.
35+
This only applies to scoped packages.
2936
required: false
30-
default: "true"
3137

3238
dry-run:
3339
description: If true, run with the --dry-run flag
3440
required: false
3541
default: "false"
3642

43+
check-version:
44+
description: Only publish if the version in package.json differs from the latest on NPM
45+
required: false
46+
default: "true"
47+
3748
outputs:
3849
type:
3950
description: The type of version change that occurred ("none", "major", "minor", "patch", etc.)

dist/index.js

Lines changed: 32 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/action/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { debug, getInput, setFailed, setOutput } from "@actions/core";
22
import { npmPublish } from "../npm-publish";
3-
import { Options } from "../options";
3+
import { Access, Options } from "../options";
44

55
/**
66
* The main entry point of the GitHub Action
@@ -18,6 +18,8 @@ async function main(): Promise<void> {
1818
registry: getInput("registry", { required: true }),
1919
package: getInput("package", { required: true }),
2020
checkVersion: getInput("check-version", { required: true }).toLowerCase() === "true",
21+
tag: getInput("tag"),
22+
access: getInput("access") as Access,
2123
dryRun: getInput("dry-run").toLowerCase() === "true",
2224
debug: debugHandler,
2325
};
@@ -39,6 +41,8 @@ async function main(): Promise<void> {
3941
setOutput("type", results.type);
4042
setOutput("version", results.version);
4143
setOutput("old-version", results.oldVersion);
44+
setOutput("tag", results.tag);
45+
setOutput("access", results.access);
4246
setOutput("dry-run", results.dryRun);
4347
}
4448
catch (error) {

0 commit comments

Comments
 (0)