diff --git a/.github/ISSUE_TEMPLATE/01-bug.yml b/.github/ISSUE_TEMPLATE/01-bug.yml index 179e277f5..1dd53e269 100644 --- a/.github/ISSUE_TEMPLATE/01-bug.yml +++ b/.github/ISSUE_TEMPLATE/01-bug.yml @@ -26,8 +26,12 @@ body: description: Any additional info you'd like to provide. label: Additional Info type: textarea + description: Report a bug trying to run the code + labels: - "type: bug" + name: 🐛 Bug + title: "🐛 Bug: " diff --git a/.github/ISSUE_TEMPLATE/02-documentation.yml b/.github/ISSUE_TEMPLATE/02-documentation.yml index 0aa9fb566..7c41c4f40 100644 --- a/.github/ISSUE_TEMPLATE/02-documentation.yml +++ b/.github/ISSUE_TEMPLATE/02-documentation.yml @@ -18,8 +18,12 @@ body: description: Any additional info you'd like to provide. label: Additional Info type: textarea + description: Report a typo or missing area of documentation + labels: - "area: documentation" + name: 📝 Documentation + title: "📝 Documentation: " diff --git a/.github/ISSUE_TEMPLATE/03-feature.yml b/.github/ISSUE_TEMPLATE/03-feature.yml index 437eed535..fbaf1ed80 100644 --- a/.github/ISSUE_TEMPLATE/03-feature.yml +++ b/.github/ISSUE_TEMPLATE/03-feature.yml @@ -18,8 +18,12 @@ body: description: Any additional info you'd like to provide. label: Additional Info type: textarea + description: Request that a new feature be added or an existing feature improved + labels: - "type: feature" + name: 🚀 Feature + title: "🚀 Feature: " diff --git a/.github/ISSUE_TEMPLATE/04-tooling.yml b/.github/ISSUE_TEMPLATE/04-tooling.yml index a3dd8d9b1..506981913 100644 --- a/.github/ISSUE_TEMPLATE/04-tooling.yml +++ b/.github/ISSUE_TEMPLATE/04-tooling.yml @@ -20,8 +20,12 @@ body: description: Any additional info you'd like to provide. label: Additional Info type: textarea + description: Report a bug or request an enhancement in repository tooling + labels: - "area: tooling" + name: 🛠 Tooling + title: "🛠 Tooling: " diff --git a/src/blocks/blockAllContributors.test.ts b/src/blocks/blockAllContributors.test.ts index a4227ae62..22ad353b7 100644 --- a/src/blocks/blockAllContributors.test.ts +++ b/src/blocks/blockAllContributors.test.ts @@ -68,8 +68,10 @@ describe("blockAllContributors", () => { GITHUB_TOKEN: \${{ secrets.ACCESS_TOKEN }} uses: JoshuaKGoldberg/all-contributors-auto-action@v0.5.0 + name: Contributors + on: push: branches: @@ -187,8 +189,10 @@ describe("blockAllContributors", () => { GITHUB_TOKEN: \${{ secrets.ACCESS_TOKEN }} uses: JoshuaKGoldberg/all-contributors-auto-action@v0.5.0 + name: Contributors + on: push: branches: @@ -305,8 +309,10 @@ describe("blockAllContributors", () => { GITHUB_TOKEN: \${{ secrets.ACCESS_TOKEN }} uses: JoshuaKGoldberg/all-contributors-auto-action@v0.5.0 + name: Contributors + on: push: branches: diff --git a/src/blocks/blockCTATransitions.test.ts b/src/blocks/blockCTATransitions.test.ts index ab0bc5556..ed5cf47c9 100644 --- a/src/blocks/blockCTATransitions.test.ts +++ b/src/blocks/blockCTATransitions.test.ts @@ -50,21 +50,15 @@ describe("blockCTATransitions", () => { uses: mshick/add-pr-comment@v2 with: issue: \${{ github.event.pull_request.number }} - message: >- - 🤖 Beep boop! I ran \`npx create-typescript-app\` and it updated some - files. + message: |- + 🤖 Beep boop! I ran \`npx create-typescript-app\` and it updated some files. - I went ahead and checked those changes into this PR for you. Please - review the latest commit to see if you want to merge it. + I went ahead and checked those changes into this PR for you. Please review the latest commit to see if you want to merge it. Cheers! — _The Friendly Bingo Bot_ 💝 - > â„šī¸ These automatic commits keep your repository up-to-date with new - versions of - [create-typescript-app](https://github.com/JoshuaKGoldberg/create-typescript-app). - If you want to opt out, delete your - \`.github/workflows/cta-transitions.yml\` file. + > â„šī¸ These automatic commits keep your repository up-to-date with new versions of [create-typescript-app](https://github.com/JoshuaKGoldberg/create-typescript-app). If you want to opt out, delete your \`.github/workflows/cta-transitions.yml\` file. using: composite ", }, @@ -87,13 +81,16 @@ describe("blockCTATransitions", () => { - if: steps.check.outcome == 'skipped' run: echo 'Skipping transition mode because the PR does not appear to be an automated or owner-created update to create-typescript-app.' + name: CTA + on: pull_request: branches: - main + permissions: pull-requests: write ", diff --git a/src/blocks/blockCTATransitions.ts b/src/blocks/blockCTATransitions.ts index ee96e3fbd..7073a5c69 100644 --- a/src/blocks/blockCTATransitions.ts +++ b/src/blocks/blockCTATransitions.ts @@ -4,7 +4,7 @@ import { resolveUses } from "./actions/resolveUses.js"; import { blockPackageJson } from "./blockPackageJson.js"; import { blockRepositoryBranchRuleset } from "./blockRepositoryBranchRuleset.js"; import { createSoloWorkflowFile } from "./files/createSoloWorkflowFile.js"; -import { formatYamlAction } from "./files/formatYamlAction.js"; +import { formatYaml } from "./files/formatYaml.js"; export const blockCTATransitions = base.createBlock({ about: { @@ -28,7 +28,7 @@ export const blockCTATransitions = base.createBlock({ ".github": { actions: { transition: { - "action.yml": formatYamlAction({ + "action.yml": formatYaml({ description: "Runs create-typescript-app in transition mode", name: "Transition", runs: { @@ -65,7 +65,9 @@ export const blockCTATransitions = base.createBlock({ issue: "${{ github.event.pull_request.number }}", message: [ "🤖 Beep boop! I ran `npx create-typescript-app` and it updated some files.", + "", "I went ahead and checked those changes into this PR for you. Please review the latest commit to see if you want to merge it.", + "", "Cheers!", " — _The Friendly Bingo Bot_ 💝", "", diff --git a/src/blocks/blockGitHubActionsCI.test.ts b/src/blocks/blockGitHubActionsCI.test.ts index b54c73458..0f167df68 100644 --- a/src/blocks/blockGitHubActionsCI.test.ts +++ b/src/blocks/blockGitHubActionsCI.test.ts @@ -49,8 +49,10 @@ describe("blockGitHubActionsCI", () => { steps: - uses: github/accessibility-alt-text-bot@v1.4.0 + name: Accessibility Alt Text Bot + on: issue_comment: types: @@ -65,6 +67,7 @@ describe("blockGitHubActionsCI", () => { - edited - opened + permissions: issues: write pull-requests: write @@ -82,13 +85,16 @@ describe("blockGitHubActionsCI", () => { echo "Don't worry if the previous step failed." echo "See https://github.com/actions-ecosystem/action-remove-labels/issues/221." + name: PR Review Requested + on: pull_request_target: types: - review_requested + permissions: pull-requests: write ", @@ -153,8 +159,10 @@ describe("blockGitHubActionsCI", () => { steps: - uses: github/accessibility-alt-text-bot@v1.4.0 + name: Accessibility Alt Text Bot + on: issue_comment: types: @@ -169,6 +177,7 @@ describe("blockGitHubActionsCI", () => { - edited - opened + permissions: issues: write pull-requests: write @@ -186,13 +195,16 @@ describe("blockGitHubActionsCI", () => { echo "Don't worry if the previous step failed." echo "See https://github.com/actions-ecosystem/action-remove-labels/issues/221." + name: PR Review Requested + on: pull_request_target: types: - review_requested + permissions: pull-requests: write ", @@ -264,8 +276,10 @@ describe("blockGitHubActionsCI", () => { steps: - uses: github/accessibility-alt-text-bot@v1.4.0 + name: Accessibility Alt Text Bot + on: issue_comment: types: @@ -280,6 +294,7 @@ describe("blockGitHubActionsCI", () => { - edited - opened + permissions: issues: write pull-requests: write @@ -298,8 +313,10 @@ describe("blockGitHubActionsCI", () => { with: VAR_WITH: 'true' + name: CI + on: pull_request: ~ push: @@ -318,13 +335,16 @@ describe("blockGitHubActionsCI", () => { echo "Don't worry if the previous step failed." echo "See https://github.com/actions-ecosystem/action-remove-labels/issues/221." + name: PR Review Requested + on: pull_request_target: types: - review_requested + permissions: pull-requests: write ", diff --git a/src/blocks/blockGitHubActionsCI.ts b/src/blocks/blockGitHubActionsCI.ts index e4c1bd218..7404f93b0 100644 --- a/src/blocks/blockGitHubActionsCI.ts +++ b/src/blocks/blockGitHubActionsCI.ts @@ -6,7 +6,7 @@ import { blockRemoveFiles } from "./blockRemoveFiles.js"; import { blockRepositoryBranchRuleset } from "./blockRepositoryBranchRuleset.js"; import { createMultiWorkflowFile } from "./files/createMultiWorkflowFile.js"; import { createSoloWorkflowFile } from "./files/createSoloWorkflowFile.js"; -import { formatYamlAction } from "./files/formatYamlAction.js"; +import { formatYaml } from "./files/formatYaml.js"; export const zActionStep = z.intersection( z.object({ @@ -46,7 +46,7 @@ export const blockGitHubActionsCI = base.createBlock({ ".github": { actions: { prepare: { - "action.yml": formatYamlAction({ + "action.yml": formatYaml({ description: "Prepares the repo for a typical CI job", name: "Prepare", runs: { diff --git a/src/blocks/blockReleaseIt.test.ts b/src/blocks/blockReleaseIt.test.ts index 122943ae3..3f902c79a 100644 --- a/src/blocks/blockReleaseIt.test.ts +++ b/src/blocks/blockReleaseIt.test.ts @@ -88,13 +88,16 @@ describe("blockReleaseIt", () => { Cheers! đŸ“Ļ🚀 + name: Post Release + on: release: types: - published + permissions: issues: write pull-requests: write @@ -102,6 +105,7 @@ describe("blockReleaseIt", () => { "release.yml": "concurrency: group: \${{ github.workflow }} + jobs: release: runs-on: ubuntu-latest @@ -117,13 +121,16 @@ describe("blockReleaseIt", () => { NPM_TOKEN: \${{ secrets.NPM_TOKEN }} uses: JoshuaKGoldberg/release-it-action@v0.2.2 + name: Release + on: push: branches: - main + permissions: contents: write id-token: write @@ -237,13 +244,16 @@ describe("blockReleaseIt", () => { Cheers! đŸ“Ļ🚀 + name: Post Release + on: release: types: - published + permissions: issues: write pull-requests: write @@ -251,6 +261,7 @@ describe("blockReleaseIt", () => { "release.yml": "concurrency: group: \${{ github.workflow }} + jobs: release: runs-on: ubuntu-latest @@ -269,13 +280,16 @@ describe("blockReleaseIt", () => { NPM_TOKEN: \${{ secrets.NPM_TOKEN }} uses: JoshuaKGoldberg/release-it-action@v0.2.2 + name: Release + on: push: branches: - main + permissions: contents: write id-token: write diff --git a/src/blocks/files/formatYaml.ts b/src/blocks/files/formatYaml.ts index 21a77840d..c22b31fe6 100644 --- a/src/blocks/files/formatYaml.ts +++ b/src/blocks/files/formatYaml.ts @@ -23,5 +23,8 @@ const options: jsYaml.DumpOptions = { }; export function formatYaml(value: unknown) { - return removeUsesQuotes(jsYaml.dump(value, options)); + return removeUsesQuotes(jsYaml.dump(value, options)).replaceAll( + /\n(\S)/g, + "\n\n$1", + ); } diff --git a/src/blocks/files/formatYamlAction.ts b/src/blocks/files/formatYamlAction.ts deleted file mode 100644 index d8251d91b..000000000 --- a/src/blocks/files/formatYamlAction.ts +++ /dev/null @@ -1,7 +0,0 @@ -import jsYaml from "js-yaml"; - -import { removeUsesQuotes } from "./removeUsesQuotes.js"; - -export function formatYamlAction(value: object) { - return removeUsesQuotes(jsYaml.dump(value).replaceAll(/\n(\S)/g, "\n\n$1")); -}