Skip to content

Commit

Permalink
chore: allow GitHub Actions CI block to have env: too
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaKGoldberg committed Dec 31, 2024
1 parent 0da6188 commit da58b38
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/next/blocks/blockGitHubActionsCI.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,10 @@ describe("blockGitHubActionsCI", () => {
name: "Validate",
steps: [
{
env: { VAR_ENV: "true" },
if: "always()",
run: "pnpm validate",
with: { ENV_VAR: "true" },
with: { VAR_WITH: "true" },
},
],
},
Expand Down Expand Up @@ -269,10 +270,12 @@ describe("blockGitHubActionsCI", () => {
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/prepare
- if: always()
- env:
VAR_ENV: "true"
if: always()
run: pnpm validate
with:
ENV_VAR: "true"
VAR_WITH: "true"
name: CI
Expand Down
1 change: 1 addition & 0 deletions src/next/blocks/blockGitHubActionsCI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export const blockGitHubActionsCI = base.createBlock({
steps: z.array(
z.intersection(
z.object({
env: z.record(z.string(), z.string()).optional(),
if: z.string().optional(),
with: z.record(z.string(), z.string()).optional(),
}),
Expand Down

0 comments on commit da58b38

Please sign in to comment.