Skip to content

Commit 366e4d2

Browse files
committed
Generate reports
1 parent 64eee68 commit 366e4d2

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

.github/workflows/main.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,8 @@ jobs:
2121
env:
2222
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2323
run: node build/index.js
24+
- name: Upload Reports
25+
uses: actions/upload-artifact@5
26+
with:
27+
name: reports
28+
path: running/reports

README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,11 @@ Optional.
4646

4747
Uses `prettier/prettier` by default, same syntax as `original_version`
4848

49-
5049
```
5150
RUN #110168 VS sosukesuzuki/prettier#fix-foo
5251
RUN sosukesuzuki/prettier#fix-foo VS 1.0.0
5352
```
5453

55-
5654
### `repositories`
5755

5856
Optional.
@@ -67,7 +65,6 @@ RUN #110168 ON https://github.com/babel/babel.git,https://github.com/prettier/pr
6765
RUN #110168 VS 1.0.0 ON https://github.com/babel/babel.git,https://github.com/prettier/prettier.git
6866
```
6967

70-
7168
## Add new project
7269

7370
Add a project info to `projects.json`.

src/execute/index.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { installPrettiers } from "../install-prettier.ts";
44
import { parseCommand } from "../parse-command.ts";
55
import { createTemporaryDirectory } from "../directory.ts";
66
import path from "node:path";
7+
import fs from "node:fs/promises";
78

89
export async function execute(commandString: string) {
910
const { alternative, original, repositories } = parseCommand(commandString);
@@ -22,7 +23,7 @@ export async function execute(commandString: string) {
2223

2324
for (const [index, project] of repositories.entries()) {
2425
await logger.log(
25-
`[${index + 1}/${repositories.length}] Running Prettier on ${project.repository} ...`,
26+
`[${index + 1}/${repositories.length}] Running Prettier on '${project.name}' ...`,
2627
);
2728

2829
const diff = await runPrettier({
@@ -32,6 +33,11 @@ export async function execute(commandString: string) {
3233
project,
3334
});
3435

36+
await fs.writeFile(
37+
path.join(`reports/${project.directoryName}.diff`),
38+
diff,
39+
);
40+
3541
result.push({
3642
project,
3743
diff,

0 commit comments

Comments
 (0)