mirror of
https://github.com/changesets/action
synced 2026-10-26 16:39:56 +08:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user