forked from microsoft/TypeScript-Website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dangerfile.ts
42 lines (33 loc) · 1.52 KB
/
dangerfile.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
// You can test it by running
// yarn danger pr https://github.com/microsoft/TypeScript-Website/pull/115
import { danger, message, markdown } from "danger"
// import { basename } from "path"
// import spellcheck from "danger-plugin-spellcheck"
// import lighthouse from "danger-plugin-lighthouse"
import { readFileSync } from "fs"
// Spell check all the things
// spellcheck({ settings: "artsy/peril-settings@spellcheck.json" })
export default () => {
const deployURL = process.env.PR_DEPLOY_URL_ROOT
message(
`Deployed to [a PR branch](${deployURL}) - [playground](${deployURL}/play) [tsconfig](${deployURL}/tsconfig) [old handbook](${deployURL}/docs/handbook/integrating-with-build-tools.html)`
)
// lighthouse()
}
// // Look for new snapshots and show in a HTML table
// const snapshots = danger.git.fileMatch("packages/typescriptlang-org/_tests/backstop_data/bitmaps_reference/*.png")
// if (snapshots.modified) {
// const oldSha = danger.github.pr.base.sha
// const newSha = danger.github.pr.head.sha
// const tables = snapshots.getKeyedPaths().modified.map(p => {
// const oldURL = `https://raw.githubusercontent.com/microsoft/TypeScript-Website/${oldSha}/${p}`
// const newURL = `https://raw.githubusercontent.com/microsoft/TypeScript-Website/${newSha}/${p}`
// return `
// ###### \`${basename(p)}\`
// Before | After
// :-------------------------:|:-------------------------:
// ![](${oldURL}) | ![](${newURL})
// `
// })
// markdown(`## Snapshots updated\n\n ${tables.join("\n\n")}`)
// }