Skip to content

Commit

Permalink
fix: pass job names from blockGitHubActionCI to blockRepositoryBranch…
Browse files Browse the repository at this point in the history
…Ruleset
  • Loading branch information
JoshuaKGoldberg committed Jan 16, 2025
1 parent 66dab46 commit 6291bed
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
26 changes: 26 additions & 0 deletions src/next/blocks/blockGitHubActionsCI.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ describe("blockGitHubActionsCI", () => {

expect(creation).toMatchInlineSnapshot(`
{
"addons": [
{
"addons": {
"requiredStatusChecks": undefined,
},
"block": [Function],
},
],
"files": {
".github": {
"actions": {
Expand Down Expand Up @@ -101,6 +109,14 @@ describe("blockGitHubActionsCI", () => {

expect(creation).toMatchInlineSnapshot(`
{
"addons": [
{
"addons": {
"requiredStatusChecks": undefined,
},
"block": [Function],
},
],
"files": {
".github": {
"actions": {
Expand Down Expand Up @@ -213,6 +229,16 @@ describe("blockGitHubActionsCI", () => {

expect(creation).toMatchInlineSnapshot(`
{
"addons": [
{
"addons": {
"requiredStatusChecks": [
"Validate",
],
},
"block": [Function],
},
],
"files": {
".github": {
"actions": {
Expand Down
7 changes: 6 additions & 1 deletion src/next/blocks/blockGitHubActionsCI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { z } from "zod";
import { createMultiWorkflowFile } from "../../steps/writing/creation/dotGitHub/createMultiWorkflowFile.js";
import { createSoloWorkflowFile } from "../../steps/writing/creation/dotGitHub/createSoloWorkflowFile.js";
import { base } from "../base.js";
import { blockRepositoryBranchRuleset } from "./blockRepositoryBranchRuleset.js";
import { CommandPhase } from "./phases.js";

export const zActionStep = z.intersection(
Expand Down Expand Up @@ -33,7 +34,6 @@ export const blockGitHubActionsCI = base.createBlock({
return {
scripts: [
{
silent: true,
commands: ["rm -rf .circleci travis.yml"],
phase: CommandPhase.Migrations,
silent: true,
Expand All @@ -45,6 +45,11 @@ export const blockGitHubActionsCI = base.createBlock({
const { jobs } = addons;

return {
addons: [
blockRepositoryBranchRuleset({
requiredStatusChecks: jobs?.map((job) => job.name),
}),
],
files: {
".github": {
actions: {
Expand Down

0 comments on commit 6291bed

Please sign in to comment.