Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fix argument validation in rollback-changelog.ts
Co-authored-by: Mads Navntoft <navntoft@github.com>
  • Loading branch information
mbg and navntoft authored Jul 28, 2026
commit 98c05a17d327d7c4055fca83114434ab56baacf6
27 changes: 9 additions & 18 deletions pr-checks/rollback-changelog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,25 +50,16 @@ export function updateChangelog(

function main() {
try {
const { values } = parseArgs({
options: {
"target-version": {
type: "string",
short: "t",
},
"rollback-version": {
type: "string",
short: "r",
},
"new-version": {
type: "string",
short: "n",
},
},
strict: true,
});
const options = {
"target-version": { type: "string", short: "t" },
"rollback-version": { type: "string", short: "r" },
"new-version": { type: "string", short: "n" },
} as const;

for (const [key, val] of Object.entries(values)) {
const { values } = parseArgs({ options, strict: true });

for (const key of Object.keys(options)) {
const val = values[key as keyof typeof values];
if (val === undefined || val.trim() === "") {
throw new Error(`Argument '--${key}' is required.`);
}
Expand Down
Loading