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
+4 -3
View File
@@ -1,5 +1,6 @@
import * as core from "@actions/core";
import * as github from "@actions/github";
import { getOptionalInput, getRequiredInput } from "../utils.ts";
type Octokit = ReturnType<typeof github.getOctokit>;
type CreateCommentParams = NonNullable<
@@ -23,9 +24,9 @@ async function main() {
);
}
const githubToken = core.getInput("github-token", { required: true });
const body = core.getInput("body", { required: true });
const updateId = core.getInput("update-id");
const githubToken = getRequiredInput("github-token");
const body = getRequiredInput("body");
const updateId = getOptionalInput("update-id");
const commentMarker = updateId ? getCommentMarker(updateId) : null;
const commentBody = commentMarker ? `${commentMarker}\n\n${body}` : body;