Fix the /version subaction to not crash on missing pr-base-branch input (#666)

* use `getOptionalInput` consistently

* introduce `getRequiredInput`

* add changeset
This commit is contained in:
Mateusz Burzyński
2026-06-23 11:26:43 +00:00
committed by GitHub
parent ccb38113ea
commit dc29b738b5
7 changed files with 44 additions and 20 deletions
+8 -4
View File
@@ -4,7 +4,11 @@ import * as core from "@actions/core";
import { Git } from "../git.ts";
import { setupOctokit } from "../octokit.ts";
import { runPublish } from "../run.ts";
import { downloadArtifact } from "../utils.ts";
import {
downloadArtifact,
getOptionalInput,
getRequiredInput,
} from "../utils.ts";
try {
await main();
@@ -13,9 +17,9 @@ try {
}
async function main() {
const githubToken = core.getInput("github-token", { required: true });
const script = core.getInput("script");
const packDirArtifactId = core.getInput("pack-dir-artifact-id");
const githubToken = getRequiredInput("github-token");
const script = getOptionalInput("script");
const packDirArtifactId = getOptionalInput("pack-dir-artifact-id");
const createGithubReleases = core.getBooleanInput("create-github-releases");
// If the user needs to change the cwd, set `working-directory` in the step instead