Skip to content

Commit d0ff0fc

Browse files
fix: pass job names from blockGitHubActionCI to blockRepositoryBranchRuleset (#1891)
## PR Checklist - [x] Addresses an existing open issue: fixes #1887 - [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 5ac2ebe commit d0ff0fc

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

src/next/blocks/blockGitHubActionsCI.test.ts

+26
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@ describe("blockGitHubActionsCI", () => {
1212

1313
expect(creation).toMatchInlineSnapshot(`
1414
{
15+
"addons": [
16+
{
17+
"addons": {
18+
"requiredStatusChecks": undefined,
19+
},
20+
"block": [Function],
21+
},
22+
],
1523
"files": {
1624
".github": {
1725
"actions": {
@@ -101,6 +109,14 @@ describe("blockGitHubActionsCI", () => {
101109

102110
expect(creation).toMatchInlineSnapshot(`
103111
{
112+
"addons": [
113+
{
114+
"addons": {
115+
"requiredStatusChecks": undefined,
116+
},
117+
"block": [Function],
118+
},
119+
],
104120
"files": {
105121
".github": {
106122
"actions": {
@@ -213,6 +229,16 @@ describe("blockGitHubActionsCI", () => {
213229

214230
expect(creation).toMatchInlineSnapshot(`
215231
{
232+
"addons": [
233+
{
234+
"addons": {
235+
"requiredStatusChecks": [
236+
"Validate",
237+
],
238+
},
239+
"block": [Function],
240+
},
241+
],
216242
"files": {
217243
".github": {
218244
"actions": {

src/next/blocks/blockGitHubActionsCI.ts

+6
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { z } from "zod";
44
import { createMultiWorkflowFile } from "../../steps/writing/creation/dotGitHub/createMultiWorkflowFile.js";
55
import { createSoloWorkflowFile } from "../../steps/writing/creation/dotGitHub/createSoloWorkflowFile.js";
66
import { base } from "../base.js";
7+
import { blockRepositoryBranchRuleset } from "./blockRepositoryBranchRuleset.js";
78
import { CommandPhase } from "./phases.js";
89

910
export const zActionStep = z.intersection(
@@ -44,6 +45,11 @@ export const blockGitHubActionsCI = base.createBlock({
4445
const { jobs } = addons;
4546

4647
return {
48+
addons: [
49+
blockRepositoryBranchRuleset({
50+
requiredStatusChecks: jobs?.map((job) => job.name),
51+
}),
52+
],
4753
files: {
4854
".github": {
4955
actions: {

0 commit comments

Comments
 (0)