Skip to content

Commit 3817acc

Browse files
authored
fix(action): remove erroneous required token input check (#248)
1 parent 85420f2 commit 3817acc

File tree

5 files changed

+13
-10
lines changed

5 files changed

+13
-10
lines changed

dist/main.js

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@jsdevtools/npm-publish",
33
"description": "Fast, easy publishing to NPM",
4-
"version": "4.1.0",
4+
"version": "4.0.1",
55
"keywords": [
66
"github-action",
77
"npm",

src/action/__tests__/main.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ describe("run", () => {
1212
beforeEach(() => {
1313
vi.stubEnv("RUNNER_TEMP", "/path/to/temp");
1414

15-
when(core.getRequiredSecretInput).calledWith("token").thenReturn("abc123");
15+
when(core.getSecretInput).calledWith("token").thenReturn("abc123");
1616
when(core.getInput).calledWith("package").thenReturn("./package.json");
1717
when(core.getInput)
1818
.calledWith("registry")

src/action/core.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,12 @@ export function getInput(name: string): string | undefined {
3535
* @param name Input name
3636
* @returns The input secret value.
3737
*/
38-
export function getRequiredSecretInput(name: string): string {
39-
const inputString = ghGetInput(name, { required: true });
40-
ghSetSecret(inputString);
38+
export function getSecretInput(name: string): string | undefined {
39+
const inputString = getInput(name);
40+
if (inputString) {
41+
ghSetSecret(inputString);
42+
}
43+
4144
return inputString;
4245
}
4346

src/action/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import * as core from "./core.js";
55
/** Run the action. */
66
async function run(): Promise<void> {
77
const results = await npmPublish({
8-
token: core.getRequiredSecretInput("token"),
8+
token: core.getSecretInput("token"),
99
registry: core.getInput("registry"),
1010
package: core.getInput("package"),
1111
tag: core.getInput("tag"),

0 commit comments

Comments
 (0)