Skip to content

Commit d81c6fa

Browse files
fix: also remove parentheses in GitHub job listings (#2035)
## PR Checklist - [x] Addresses an existing open issue: fixes #2034 - [x] That issue was marked as [`status: accepting prs`](https://github.com/JoshuaKGoldberg/create-typescript-app/issues?q=is%3Aopen+is%3Aissue+label%3A%22status%3A+accepting+prs%22) - [x] Steps in [CONTRIBUTING.md](https://github.com/JoshuaKGoldberg/create-typescript-app/blob/main/.github/CONTRIBUTING.md) were taken ## Overview 🎁
1 parent 51efa47 commit d81c6fa

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed
+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { describe, expect, test } from "vitest";
2+
3+
import { createJobName } from "./createJobName.js";
4+
5+
describe(createJobName, () => {
6+
test.each([
7+
["Build", "build"],
8+
["Build?", "build"],
9+
["Build with Spaces", "build_with_spaces"],
10+
["Build (Release)", "build_release"],
11+
])("%s becomes %s", (input, expected) => {
12+
expect(createJobName(input)).toBe(expected);
13+
});
14+
});

src/blocks/files/createJobName.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
export function createJobName(label: string) {
2-
return label.toLowerCase().replaceAll("?", "").replaceAll(" ", "_");
2+
return label.replaceAll(/[?()]/g, "").replaceAll(" ", "_").toLowerCase();
33
}

0 commit comments

Comments
 (0)