Skip to content

Commit bdc07b4

Browse files
committed
Create a PR
1 parent 0f06e45 commit bdc07b4

File tree

2 files changed

+47
-3
lines changed

2 files changed

+47
-3
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Create PR to TypeScript
2+
on:
3+
workflow_dispatch: {}
4+
5+
jobs:
6+
test:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- uses: actions/checkout@v2
11+
- uses: actions/setup-node@v1
12+
with:
13+
node-version: "15"
14+
cache: npm
15+
16+
- run: npm ci
17+
- run: npm run build
18+
- run: npm test
19+
20+
- uses: actions/checkout@v2
21+
with:
22+
repository: "microsoft/TypeScript"
23+
path: "TypeScript"
24+
25+
- run: |
26+
node ./lib/migrate.js ./TypeScript
27+
28+
- uses: peter-evans/create-pull-request@v3
29+
with:
30+
path: TypeScript
31+
commit-message: "🤖 Update TypeScript DOM Libs"
32+
title: "Update TypeScript DOM Libs"
33+
body: "This PR was generated by @${{ github.actor }} from https://github.com/microsoft/TypeScript-DOM-lib-generator/"
34+
push-to-fork: typescript-bot/TypeScript
35+
branch: update-dom
36+
labels: |
37+
Domain: lib.d.ts
38+
Housekeeping
39+
token: ${{ secrets.TS_GITHUB_BOT_AUTH }}

deploy/migrate.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
// @ts-check
12
// Mainly a quick script to migrate the generated files into the
23
// lib folder of a TypeScript clone.
34
//
4-
// node ./lib/migrate.js [optional/file/path/to/tsc]
5+
// node ./deploy/migrate.js [optional/file/path/to/tsc]
56

67
import { existsSync, readdirSync, readFileSync, writeFileSync } from "fs";
78
import { join } from "path";
@@ -21,8 +22,12 @@ const filesToSend = generatedFiles.filter(
2122
(file) => file.includes("dom.") || file.includes("webworker.")
2223
);
2324

24-
const generatedDir = new URL("generated/", import.meta.url);
25-
postProcessDTSFiles({ files: filesToSend.map((f) => ({ to: f })) }, );
25+
const generatedDir = new URL("../generated/", import.meta.url);
26+
postProcessDTSFiles(
27+
/** @type {any} */
28+
({ files: filesToSend.map((f) => ({ to: f })) }),
29+
generatedDir
30+
);
2631

2732
filesToSend.forEach((file) => {
2833
const contents = readFileSync(join("generated", file), "utf8");

0 commit comments

Comments
 (0)