Skip to content

Commit 5a97f71

Browse files
committed
Improve the dangerfile
1 parent a2ab9df commit 5a97f71

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

dangerfile.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
const markdownTranslate = require('@orta/markdown-translator')
2-
import {danger, message} from "danger"
2+
import {danger, markdown} from "danger"
33

44
const go = async () => {
55
const allMDFiles = [...danger.git.modified_files, ...danger.git.created_files].filter(f => f.endsWith(".md")).filter(f => f.split("/").length > 2)
6-
console.log(allMDFiles)
6+
77

88
for (const file of allMDFiles) {
99
const fileContents = await danger.github.utils.fileContents(file)
@@ -17,7 +17,12 @@ const go = async () => {
1717
region: "eastus"
1818
})
1919

20-
message(`## Translation of ${danger.github.utils.fileLinks([file])}\n\n${translation}`)
20+
markdown(`<details open>
21+
<summary>Translation of ${danger.github.utils.fileLinks([file])}</summary>
22+
23+
${translation}
24+
25+
</details>`)
2126
};
2227
}
2328

0 commit comments

Comments
 (0)