-
-
Notifications
You must be signed in to change notification settings - Fork 80
/
Copy pathblockCTATransitions.ts
76 lines (75 loc) · 2.45 KB
/
blockCTATransitions.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
import { base } from "../base.js";
import { packageData } from "../data/packageData.js";
import { resolveUses } from "./actions/resolveUses.js";
import { blockGitHubActionsCI } from "./blockGitHubActionsCI.js";
import { blockPackageJson } from "./blockPackageJson.js";
export const blockCTATransitions = base.createBlock({
about: {
name: "CTA Transitions",
},
produce({ options }) {
return {
addons: [
blockGitHubActionsCI({
jobs: [
{
checkoutWith: {
"fetch-depth": "0",
ref: "${{github.event.pull_request.head.ref}}",
repository:
"${{github.event.pull_request.head.repo.full_name}}",
token: '"${{ secrets.ACCESS_TOKEN }}"',
},
if: "${{ startsWith(github.head_ref, 'renovate/') && contains(github.event.pull_request.title, 'create-typescript-app') }}",
name: "CTA Transitions",
steps: [
{ run: "pnpx create-typescript-app" },
{
uses: resolveUses(
"stefanzweifel/git-auto-commit-action",
"v5",
options.workflowsVersions,
),
with: {
commit_author: "The Friendly Bingo Bot <[email protected]>",
commit_message:
"Check in changes from re-running npx create-typescript-app",
commit_user_email: "[email protected]",
commit_user_name: "The Friendly Bingo Bot",
},
},
{
uses: resolveUses(
"mshick/add-pr-comment",
"v2",
options.workflowsVersions,
),
with: {
issue: "${{ github.event.pull_request.number }}",
message: [
"|",
"🤖 Beep boop! I ran `npx create-typescript-app` and found same changes.",
"Please review the latest commit to see if you want to merge it.",
"Cheers! 💝",
"",
"> This change was automatically made in CI to keep your repository up-to-date with the templating in [create-typescript-app](https://github.com/JoshuaKGoldberg/create-typescript-app).",
"> If you want to opt out of these automatic updates, delete the `.github/workflows/cta-transitions.yml` file on your `main` branch.",
].join("\n"),
"repo-token": "${{ secrets.ACCESS_TOKEN }}",
},
},
],
},
],
}),
blockPackageJson({
properties: {
devDependencies: {
"create-typescript-app": packageData.version,
},
},
}),
],
};
},
});